仅需要查询特定时间仅在美国东部时间上午10:00至美国东部时间09:59之间的表中的结果。
使用以下查询示例:
SELECT
s.id as "ID",
to_char(s.started_at AT TIME zone 'UTC-5', 'HH12:MIam') as "Start_time",
FROM
stats s
WHERE
s.started_at IS NOT NULL
任何人都有WHERE语句,无论DATE如何,都可以显示这些结果?
答案 0 :(得分:0)
将该列投射到time
:
SELECT ...
FROM states s
WHERE CAST ((s.started_at AT TIME ZONE 'EST') AS time)
BETWEEN TIME '10:00' AND TIME '21:59';