SQL截断并转换时区
我如何(按小时)截断我的convert_timezone查询结果。
SELECT
convert_timezone('UTC', 'America/New_York', RECORD_TIMESTAMP) as Time
,date_trunc('HOUR', Time) as Truncated
FROM Date
上面有效,但我想将其全部“将”全部“组合”到一行,以给我一个截断时间的结果。
How can I truncate (by hour) the result of my convert_timezone query.
SELECT
convert_timezone('UTC', 'America/New_York', RECORD_TIMESTAMP) as Time
,date_trunc('HOUR', Time) as Truncated
FROM Date
Above works but I want to 'combine' it all on one line to give me a single result of truncated time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需结合两个列
Simply Combine both columns
因此,如果您的SQL工作未完成,只需堆叠命令
提供:
Or just written as the stacked line:
So if you have the SQL working uncombined, just stack the command
gives:
Or just written as the stacked line: