英文:
Sequence function in Amazon Athena
问题
我无法使用Amazon Athena的序列函数。它显示语法错误,提示:不是窗口函数:sequence。
我编写了以下代码:
从<table_name>中选择sequence(1, 1) OVER () as seq_num
英文:
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
得分: 1
你可以考虑使用 ROW_NUMBER()。你可以选择使用:
SELECT * FROM UNNEST(sequence(1, 5))
或者
SELECT ROW_NUMBER() OVER() as seq_num FROM campaign_lookup
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论