ソースコード
with SCH as
(
SELECT CATEGORY_CODE,AGE,GENDER_CODE,round(AVG(AVERAGE_VALUE),1) avgv,COUNT(AVERAGE_VALUE) CNT from
SCHOOL_HEALTH
where SURVEY_YEAR='2019'  AND CATEGORY_CODE='10'
group by CATEGORY_CODE,AGE,GENDER_CODE
),
SCH2 as
(
SELECT PF_CODE,CATEGORY_CODE,AGE,GENDER_CODE,round(AVG(AVERAGE_VALUE),1) avgv,COUNT(1)  from
SCHOOL_HEALTH
where SURVEY_YEAR='2019' AND CATEGORY_CODE='10'
group by PF_CODE,CATEGORY_CODE,AGE,GENDER_CODE
)
select A.*,COUNT(1),A.CNT FROM SCH A
join SCH2 B on A.CATEGORY_CODE =B.CATEGORY_CODE AND A.AGE =B.AGE AND A.GENDER_CODE AND B.GENDER_CODE
AND A.avgv<= B.avgv
GROUP BY A.CATEGORY_CODE,A.AGE,A.GENDER_CODE
order by A.AGE DESC,A.GENDER_CODE DESC
提出情報
提出日時2023/08/21 10:14:52
コンテスト第8回 SQLコンテスト
問題身長と体重
受験者testmori2222222666
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量100 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
98 MB
データパターン2
WA
100 MB