ソースコード
SELECT
    tbl.CODE,tbl.NAME,tbl.SUM_QTY
FROM
(
SELECT
    ODDTL.ITEM_CODE AS CODE,
    IT.ITEM_NAME AS NAME,
    SUM(ODDTL.ORDER_QTY) AS SUM_QTY
FROM ORDERS AS OD
 INNER JOIN ORDERS_DTL AS ODDTL
  ON OD.ORDER_NO = ODDTL.ORDER_NO
 INNER JOIN WAREHOUSE AS WH
  ON OD.WH_CODE = WH.WH_CODE
 LEFT OUTER JOIN ITEM AS IT
  ON ODDTL.ITEM_CODE = IT.ITEM_CODE
WHERE WH.WH_NAME = '浦和倉庫'
GROUP BY IT.ITEM_NAME
ORDER BY SUM(ODDTL.ORDER_QTY) desc,ODDTL.ITEM_CODE desc
) tbl
WHERE tbl.SUM_QTY >= 50
提出情報
提出日時2024/06/10 11:58:19
コンテスト第1回 SQLコンテスト初級編
問題売れ筋商品
受験者yy
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量92 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
92 MB
データパターン2
AC
91 MB