LoginSignup
0
0

More than 1 year has passed since last update.

【Athena】指定期間の日付一覧を取得する【Presto】

Posted at

指定期間の日付一覧が欲しい

自分の場合は作成した時系列データに抜けている日付がないかのチェックのために日付一覧が欲しくなったため調べました。
以下のSQLで取得できます。timestamp型で取得可能です。

SELECT timestamp AS DAY
FROM UNNEST(
      SEQUENCE(
        cast('2022-01-01' AS date), 
        cast('2022-12-31' AS date), 
        INTERVAL '1' DAY
      ) 
    ) AS t1(timestamp)

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0