ソースコード
WITH RECURSIVE DATES(x) AS (
  VALUES('2022-08-01')
  UNION ALL
  SELECT date(x, '+1 day')
  FROM dates
  WHERE x < '2022-08-31'
)
SELECT 
    strftime('%Y-%m-%d', x) AS "REGIST_DATE" ,
    (CASE 
        WHEN strftime('%w', x) == "0" THEN "日"
        WHEN strftime('%w', x) == "1" THEN "月"
        WHEN strftime('%w', x) == "2" THEN "火"
        WHEN strftime('%w', x) == "3" THEN "水"
        WHEN strftime('%w', x) == "4" THEN "木"
        WHEN strftime('%w', x) == "5" THEN "金"
        WHEN strftime('%w', x) == "6" THEN "土"
        ELSE strftime('%w', x)
    END) AS "WK",
    CASE WHEN temp_users.count IS NULL THEN 0 ELSE temp_users.count END AS "TOTAL"
FROM DATES
LEFT OUTER JOIN (
    SELECT 
        strftime('%Y-%m-%d', CONFIRMED_AT) AS "CONFIRMED_AT",
        count(*) AS "count"
    FROM USERS
    WHERE VALID_FLG = 1
    AND strftime('%Y-%m-%d', CONFIRMED_AT) >= "2022-08-01" AND strftime('%Y-%m-%d', CONFIRMED_AT) <= "2022-08-31"
    GROUP BY strftime('%Y-%m-%d', CONFIRMED_AT)
) AS temp_users ON temp_users.CONFIRMED_AT = strftime('%Y-%m-%d', x)
提出情報
提出日時2022/12/10 18:35:13
コンテスト第4回 SQLコンテスト
問題登録人数の日別集計
受験者JK20221212
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
4/4
状態
メモリ使用量
データパターン1
AC
78 MB
データパターン2
AC
79 MB
データパターン3
AC
78 MB
データパターン4
AC
78 MB