I need to generate a list of dates between two dates start date and end date here I need from 1/1/2022 to the end of the year on AWS Athena without creating table I need only query view
the output should be:
|date|
|--|
|1/1/2022 |
|2/1/2022 |
|3/1/2022 |
etc to a specific date.
2
Answers
You can use the sequence function to generate an array with a start date and an end date
You can use
sequence
function which supports dates and timestamps:And then use
unnest
which will flatten the generated array:Output: