ソースコード
SELECT a.PF_CODE as CODE
       ,b.PF_NAME as NAME
       ,round((a.o / (select sum(cast ( AMT as real))
                       FROM DRINK_HABITS
                       WHERE 0 = 0
                       and (GENDER_CODE = "2"
                       or GENDER_CODE = "3")
                       and CATEGORY_CODE = "110"
                       )) * 100 , 1) as PERCENTAGE
  FROM (SELECT PF_CODE
               ,SUM(cast( AMT as real)) as o
        FROM DRINK_HABITS
        WHERE CATEGORY_CODE = "120"
        and (GENDER_CODE = "2"
        or GENDER_CODE = "3")
        GROUP BY PF_CODE
        ) as a
 
  join PREFECTURE as b
    on a.PF_CODE = b.PF_CODE
    
  order by PERCENTAGE desc
           ,a.PF_CODE desc;
           
           
提出情報
提出日時2022/09/21 18:12:44
コンテスト第2回 SQLコンテスト
問題飲酒率
受験者inkmori
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量95 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
95 MB
データパターン2
WA
95 MB