2个bigquery时间戳字段之间的分钟差异

use*_*267 14 google-bigquery

如何在google bigquery中的两个时间戳字段之间获得分钟差异?我所知道的唯一功能是Datediff,它在一天中给出了差异

谢谢

Pau*_*vis 20

Pentium10的答案适用于Legacy SQL.如果你使用的是标准SQL,你可以使用TIMESTAMP_DIFF,它会为你做数学运算:

TIMESTAMP_DIFF(timestamp_1, timestamp_2, MINUTE)
Run Code Online (Sandbox Code Playgroud)

https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#timestamp-functions