ソースコード
select  R.AREA_CODE CODE
        ,R.AREA_NAME NAME
        ,s2022.ranking as "2022_RANK"
        ,s2022.RATIO || '%' as "2022_RATIO"
        ,s2017.ranking as "2017_RANK"
        ,s2017.RATIO || '%' as "2017_RATIO"
        ,s2012.ranking as "2012_RANK"
        ,s2012.RATIO || '%' as "2012_RATIO"
  from  AREA R,
(select  h.AREA_CODE
        ,round(1.00 * h.FOOD_EXP * 100 / h.CONSUMPTION_EXP,1) RATIO
        ,DENSE_RANK() OVER (ORDER BY round(1.00 * h.FOOD_EXP * 100 / h.CONSUMPTION_EXP,1) ) ranking
  from  HOUSEHOLD_SURVEY h
 where  h.SURVEY_YEAR = '2022') s2022
 ,(select  h.AREA_CODE
        ,round(1.00 * h.FOOD_EXP * 100 / h.CONSUMPTION_EXP,1) RATIO
        ,DENSE_RANK() OVER (ORDER BY round(1.00 * h.FOOD_EXP * 100 / h.CONSUMPTION_EXP,1) ) ranking
  from  HOUSEHOLD_SURVEY h
 where  h.SURVEY_YEAR = '2017') s2017
 ,(select  h.AREA_CODE
        ,round(1.00 * h.FOOD_EXP * 100 / h.CONSUMPTION_EXP,1) RATIO
        ,DENSE_RANK() OVER (ORDER BY round(1.00 * h.FOOD_EXP * 100 / h.CONSUMPTION_EXP,1) ) ranking
  from  HOUSEHOLD_SURVEY h
 where  h.SURVEY_YEAR = '2012') s2012
 
 where  R.AREA_CODE = s2022.AREA_CODE
    and R.AREA_CODE = s2017.AREA_CODE
    and R.AREA_CODE = s2012.AREA_CODE
 order by s2022.ranking,R.AREA_CODE
提出情報
提出日時2023/12/17 16:28:24
コンテスト第10回 SQLコンテスト
問題食料費の割合
受験者ksw_201815
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量99 MB
メッセージ
テストケース(通過数/総数)
0/3
状態
メモリ使用量
データパターン1
WA
99 MB
データパターン2
WA
94 MB
データパターン3
WA
86 MB