简体   繁体   English

当前在 BigQuery 中?

[英]CURRENT in BigQuery?

I've noticed that CURRENT is a reserved keyword for BigQuery at: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical .我注意到CURRENT是 BigQuery 的保留关键字: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical

What exactly does CURRENT do? CURRENT到底是做什么的? I've only seen it as a prefix for things such as CURRENT_TIME() , CURRENT_DATE() , and other such stuff but have never seen it by itself.我只将它视为CURRENT_TIME()CURRENT_DATE()和其他此类东西的前缀,但从未单独见过它。 Is this just reserved for future usage or do any SQL statements contain that as a keyword?这只是为将来使用而保留,还是任何 SQL 语句都包含它作为关键字?

Just to add on the comment of @Jaytiger:只是添加@Jaytiger的评论:

CURRENT keyword seems to be reserved as a part of SQL 2016 spec. CURRENT关键字似乎保留为 SQL 2016 规范的一部分。 en.wikipedia.org/wiki/SQL_reserved_words And you can check it's usage in another DBMS implementations like Oracle, SQL Server. en.wikipedia.org/wiki/SQL_reserved_words 您可以检查它在其他 DBMS 实现中的使用情况,例如 Oracle、SQL 服务器。 hope this is helpful.希望这会有所帮助。 stackoverflow.com/questions/49110728/where-current-of-in-pl-sql stackoverflow.com/questions/49110728/where-current-of-in-pl-sql

In BigQuery CURRENT clause is used on defining frame_start and frame_end in window functions .在 BigQuery 中, CURRENT子句用于在window 函数中定义frame_start 和 frame_end

A window function, also known as an analytic function, computes values over a group of rows and returns a single result for each row. window function,也称为分析 function,计算一组行的值并为每行返回一个结果。

A common usage for this is calculating a cumulative sum for each category in the table.一个常见的用法是计算表中每个类别的累积总和 See BigQuery window function examples for reference.请参阅BigQuery window function 示例以供参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM