ソースコード
-- SELECT * FROM ACCESS_LOG WHERE   LOGIN_DATETIME >= '2023-08-01'   AND  LOGIN_DATETIME < '2023-09-01' ORDER BY MEMBER_CODE
-- SELECT date(MIN(LOGIN_DATETIME)) AS LOGIN_DATETIME,MEMBER_CODE FROM ACCESS_LOG WHERE   LOGIN_DATETIME >= '2023-08-01'   AND  LOGIN_DATETIME < '2023-09-01' GROUP BY MEMBER_CODE

SELECT 
  date(a2.LOGIN_DATETIME) AS FIRST_LOGIN
 ,COUNT(*) AS MEMBER_CNT
FROM (SELECT MIN(LOGIN_DATETIME) AS LOGIN_DATETIME,MEMBER_CODE FROM ACCESS_LOG WHERE   LOGIN_DATETIME >= '2023-08-01'   AND  LOGIN_DATETIME < '2023-09-01' GROUP BY MEMBER_CODE) a2
GROUP BY date(FIRST_LOGIN)
ORDER BY FIRST_LOGIN desc; 

-- SELECT 
-- date(a2.LOGIN_DATETIME) AS FIRST_LOGIN
-- -- ,a1.MEMBER_CODE
-- -- ,COUNT(a1.MEMBER_CODE) AS MEMBER_CNT
-- ,COUNT(*) AS MEMBER_CNT
-- FROM ACCESS_LOG as a1
-- INNER JOIN (SELECT MIN(LOGIN_DATETIME) AS LOGIN_DATETIME,MEMBER_CODE FROM ACCESS_LOG WHERE   LOGIN_DATETIME >= '2023-08-01'   AND  LOGIN_DATETIME < '2023-09-01' GROUP BY MEMBER_CODE) as a2
--   ON a1.MEMBER_CODE = a2.MEMBER_CODE 
--   AND a1.LOGIN_DATETIME = a2.LOGIN_DATETIME
-- WHERE a1.LOGIN_DATETIME >= '2023-08-01' 
--   AND  a1.LOGIN_DATETIME < '2023-09-01' 
-- GROUP BY date(FIRST_LOGIN)
-- ORDER BY FIRST_LOGIN desc; 
提出情報
提出日時2023/10/15 23:23:49
コンテスト第9回 SQLコンテスト
問題新規ログイン数
受験者Hodgepodge
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量79 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
76 MB
データパターン2
WA
79 MB