ソースコード
SELECT
  s.CODE AS CODE,
  i.ITEM_NAME AS NAME,
  s.SUM_QTY AS SUM_QTY
FROM (
  SELECT
    od.ITEM_CODE AS CODE,
    SUM(ORDER_QTY) AS SUM_QTY
  FROM ORDERS AS o
  INNER JOIN WAREHOUSE AS wh
    ON o.WH_CODE = wh.WH_CODE
  INNER JOIN ORDERS_DTL AS od
    ON o.ORDER_NO = od.ORDER_NO
  WHERE
    wh.WH_NAME = '浦和倉庫'
  GROUP BY od.ITEM_CODE
  HAVING SUM(ORDER_QTY) >= 50
) AS s
LEFT JOIN ITEM AS i ON s.CODE = i.ITEM_CODE
ORDER BY SUM_QTY DESC, CODE DESC;
提出情報
提出日時2024/06/10 16:26:23
コンテスト第1回 SQLコンテスト初級編
問題売れ筋商品
受験者harry0000
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量97 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
97 MB
データパターン2
AC
95 MB