ソースコード
WITH OI AS (
    SELECT
        ORDER_NO AS NO,
        OD.ITEM_CODE AS CODE,
        ITEM_NAME AS NAME,
        ORDER_QTY AS OQ
    FROM
        ORDERS_DTL AS OD
    LEFT OUTER JOIN ITEM AS I ON
        OD.ITEM_CODE = I.ITEM_CODE
)

SELECT
    CODE,
    NAME,
    SUM(OQ) AS SUM_QTY
FROM
    ORDERS AS O
LEFT OUTER JOIN OI ON
    O.ORDER_NO = OI.NO
LEFT OUTER JOIN WAREHOUSE AS W ON
    O.WH_CODE = W.WH_CODE
WHERE
    W.WH_NAME = '浦和倉庫'
GROUP BY
    CODE
HAVING
    SUM(OQ) >= 50
ORDER BY
    SUM_QTY DESC,
    CODE DESC
提出情報
提出日時2024/06/10 10:53:25
コンテスト第1回 SQLコンテスト初級編
問題売れ筋商品
受験者be-yan
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量98 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
98 MB
データパターン2
AC
98 MB