gpt4 book ai didi

垂直数据库 : Need to use a date string and convert as part of where clause

转载 作者:行者123 更新时间:2023-12-02 21:25:32 24 4
gpt4 key购买 nike

我在vertica中有一个字段

deviceReceiptTime   -5  Integer 19  8

它似乎保存了毫秒

1504828819089
1504828819071

Epoch date Human readable date (GMT)
1504828819 2017-09-08 00:00:19

我希望分析师能够输入标准日期格式,例如YYYY-MMDD HH24MISS 而不是先转换为毫秒。

而不是

where deviceReceiptTime Between 1490270439780 and 1490270448888

最佳答案

也许是这样的......

where deviceReceiptTime between 
extract ( epoch from <lower_limit ) and
extract ( epoch from <higher_limit> )

例如:

where deviceReceiptTime between 
extract ( epoch from '2017-02-08 00:00:00'::timestamp ) and
extract ( epoch from '2017-04-08 00:00:00'::timestamp )

关于垂直数据库 : Need to use a date string and convert as part of where clause,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46126634/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com