【发布时间】:2020-03-12 03:58:47
【问题描述】:
不管sql是在哪一天执行的,我都需要得到下周一的日期。
我认为7 - day_of_week(current_date)%7 + 1 的逻辑会起作用,但是如何获取日期。
select current_date;
_col0
1 2019-11-16
select (7 - day_of_week(current_date)%7+1)
_col0
1 2
或者有没有其他更好的方法来做同样的事情。
我将不胜感激!
【问题讨论】:
标签: sql datetime presto amazon-athena date-arithmetic