05 Jun 19 · Ryan-Dallas · #bigquery ·   Bookmark   ×

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:

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


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