ソースコード

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