我有一个日历表,但我不确定如何使用 amazon redshift 或 amazon athena(presto) 使工作日减法工作。我看过一些帖子提到使用日历,但无法让它与 redshift 或 athena 一起使用。任何帮助,将不胜感激。这是我到目前为止。它是我在工作日需要的 2 个不同表之间的减法。谢谢
table1.createddate (start date)
table2.createddate (end date)
cal.date (cal table,column 'date' is what i can inner join with)
cal.is_week_end is either yes or no on this table.
SELECT table1.id,table1.createddate,table2.NAME,table2.createddate,Datediff(day,table2.createddate) AS age1
FROM table2
LEFT JOIN table1
ON table2.id = table1.id2;