Skip to content
Advertisement

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.

What exactly does CURRENT do? 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. Is this just reserved for future usage or do any SQL statements contain that as a keyword?

Advertisement

Answer

Just to add on the comment of @Jaytiger:

CURRENT keyword seems to be reserved as a part of SQL 2016 spec. en.wikipedia.org/wiki/SQL_reserved_words And you can check it’s usage in another DBMS implementations like Oracle, SQL Server. hope this is helpful. 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.

A window function, also known as an analytic function, computes values over a group of rows and returns a single result for each row.

A common usage for this is calculating a cumulative sum for each category in the table. See BigQuery window function examples for reference.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement