我正在尝试从我的表中获取一些数据 - 我只需要在固定日期范围内的特定时间(一天晚上 22:00 到第二天早上 06:00 之间)。
这是我到目前为止:
create new_table
as select table.v1, table.localminute from table
where date(table.localminute) between
date('2013-11-01 00:00:00-05') and date('2014-12-01 00:00:00-05')
and hour(table.localminute) between 22 and 6
Run Code Online (Sandbox Code Playgroud)
我不确定如何获取每天 22:00:00-05 和 06:00:00-05 之间的数据。
我还考虑过对日期使用通配符,但要么不起作用,要么我的实现不正确。任何帮助将不胜感激!
我使用以下链接中的信息进行设置 - 不确定我需要做什么。