ソースコード
WITH BEF_WEIGHT AS (
SELECT MIN(HC.CHECKUP_DATE), HC.MEMBER_CODE AS BEF_CODE, HC.WEIGHT AS BEF_WT, MM.LAST_NAME || MM.FIRST_NAME AS FULLNAME
FROM HEALTH_CHECKUP HC
INNER JOIN MEMBER_MST MM
ON HC.MEMBER_CODE = MM.MEMBER_CODE
GROUP BY HC.MEMBER_CODE)
SELECT MAX(HC.CHECKUP_DATE) AS CK_DATE, HC.MEMBER_CODE AS CODE, MM.LAST_NAME || MM.FIRST_NAME AS NAME, (HC.WEIGHT * 10 - (SELECT BEF_WT FROM BEF_WEIGHT WHERE HC.MEMBER_CODE = BEF_CODE )*10)/10 AS CHG_WT
FROM HEALTH_CHECKUP HC
INNER JOIN MEMBER_MST MM
ON HC.MEMBER_CODE = MM.MEMBER_CODE
GROUP BY HC.MEMBER_CODE
HAVING CHG_WT <= -5 OR CHG_WT >= 5
ORDER BY CHG_WT DESC, CODE DESC
提出情報
提出日時2024/09/27 16:36:30
コンテスト第13回 SQLコンテスト
問題体重差分
受験者miroku
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
WA
85 MB