ソースコード
WITH 
    tall AS (
    SELECT AVERAGE_VALUE
    FROM SCHOOL_HEALTH
    WHERE CATEGORY_CODE = '10'
    ),
    weight AS (
    SELECT AVERAGE_VALUE
    FROM SCHOOL_HEALTH
    WHERE CATEGORY_CODE = '20'
    )
    

SELECT AGE AS AGE
    ,where case
    when GENDER_CODE='20' then SET GENDER_CODE='MALE'
    when GENDER_CODE='30' then SET GENDER_CODE='FEMALE'
    AS GENDER
    ,AVG(tall) AS H_AVG
    , AS H_PER
    ,AVG(weight) AS W_AVG
    , AS W_PER
FROM SCHOOL_HEALTH
WHERE SURVEY_YEAR = '2019'
AND AVERAGE_VALUE
GROUP BY AGE
ORDER BY AGE DESC
    ,GENDER_CODE DESC
提出情報
提出日時2023/08/20 22:53:44
コンテスト第8回 SQLコンテスト
問題身長と体重
受験者UY
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量85 MB
メッセージ
SQLITE_ERROR: near "where": syntax error
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
85 MB
データパターン2
RE
82 MB