Convert Teradata qualify row_number() to Google BigQuery

How can I translate this query into Big query?

select 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 subsequent_month, ROW_NUMBER() OVER (ORDER BY tablename) as RN
      FROM dbc.tables 
) WHERE RN <= 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