2

I am not able to use the sequence function amazon athena. It shows a syntax error saying : Not a window function: sequence

I wrote the following code : SELECT sequence(1, 1) OVER () as seq_num FROM <table_name>

1 Answers1

1

You might want to use ROW_NUMBER(). You can either use:

SELECT * FROM UNNEST(sequence(1, 5))

or

SELECT ROW_NUMBER() OVER() as seq_num FROM campaign_lookup
AswinRajaram
  • 1,519
  • 7
  • 18