I want to write this query in Presto:
SELECT
*
FROM (
SELECT GENERATE_SERIES(0, 30) days
)
But it says that function GENERATE_SERIES doesn't exist in Presto. What can I use instead?
CodePudding user response:
You can use sequence
with unnest
:
SELECT days
FROM (SELECT sequence(0, 30) as d)
CROSS JOIN UNNEST (d) as t(days)