gpt4 book ai didi

sql - 大查询 : extract SECOND from TIMESTAMP

转载 作者:行者123 更新时间:2023-12-01 23:55:16 25 4
gpt4 key购买 nike

我如何运行这个查询?

错误消息:参数类型的函数 EXTRACT 没有匹配的签名:DATE_TIME_PART FROM INT64。支持的签名:EXTRACT(DATE_TIME_PART FROM DATE); EXTRACT(DATE_TIME_PART FROM TIMESTAMP [AT TIME ZONE STRING]);提取(DATE_TIME_PART FROM DATETIME);在 [12:12] 提取(DATE_TIME_PART FROM TIME)

他们都给出相同的错误信息

 WHERE EXTRACT( SECOND FROM event_timestamp )
- EXTRACT( SECOND FROM last_event) >= (60 * 10)
OR last_event IS NULL
 WHERE EXTRACT( SECOND FROM event_timestamp AT TIME ZONE "UTC")
- EXTRACT( SECOND FROM last_event AT TIME ZONE "UTC") >= (60 * 10)
OR last_event IS NULL

example timestamp

最佳答案

使用TIMESTAMP_MICROS()

WHERE EXTRACT( SECOND FROM TIMESTAMP_MICROS(event_timestamp))
- EXTRACT( SECOND FROM last_event) >= (60 * 10)
OR last_event IS NULL

关于sql - 大查询 : extract SECOND from TIMESTAMP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62828092/

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