05 Jun 19 · Ryan-Dallas ·       Add to Favorites  

Convert Teradata qualify row_number() to Google BigQuery

How can I translate this query into Big query?

(select row_number() over (order by tablename) subsequent_month from dbc.tables 
qualify row_number() over (order by tablename) <= 24)

There is no QUALIFY command in Bigquery.

Below is for BigQuery Standard SQL equivalent:

#standardSQL
SELECT subsequent_month FROM (
  SELECT ROW_NUMBER() OVER (ORDER BY tablename) subsequent_month 
  FROM dbc.tables 
) WHERE subsequent_month <= 24

Ryan-Dallas

posted on 05 Jun 19

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds

Copied