Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Teradata 如何在SQL中计算周末?_Teradata - Fatal编程技术网

Teradata 如何在SQL中计算周末?

Teradata 如何在SQL中计算周末?,teradata,Teradata,给定日期格式yyyy-mm-dd,如何计算周末的星期六?对于星期天,我想计算下一周的星期六。我使用的是teradata 15。当您在周六运行查询时,您希望得到当天还是下周六 next_day(date-1, 'sat') -- same day next_day(date, 'sat') -- next Saturday 当您在周六运行查询时,您希望得到当天还是下周六 next_day(date-1, 'sat') -- same day next_day(date, 'sat'

给定日期格式yyyy-mm-dd,如何计算周末的星期六?对于星期天,我想计算下一周的星期六。我使用的是teradata 15。

当您在周六运行查询时,您希望得到当天还是下周六

next_day(date-1, 'sat')  -- same day

next_day(date, 'sat')    -- next Saturday

当您在周六运行查询时,您希望得到当天还是下周六

next_day(date-1, 'sat')  -- same day

next_day(date, 'sat')    -- next Saturday