ソースコード
WITH S1 AS (
    SELECT
        ORDER_NO,
        ITEM_CODE
    FROM
        ORDERS_DTL
    GROUP BY
        ORDER_NO, ITEM_CODE
)

SELECT
    OD.ITEM_CODE AS CODE,
    IT.ITEM_NAME AS NAME,
    OD.TOTAL AS SUM_QTY
FROM
    ORDERS OH
    INNER JOIN WAREHOUSE WH ON OH.WH_CODE = WH.WH_CODE
    INNER JOIN S1 ON OH.ORDER_NO = S1.ORDER_NO
    INNER JOIN 
    (
        SELECT
            ITEM_CODE,
            SUM(ORDER_QTY) AS TOTAL
        FROM
            ORDERS_DTL
        GROUP BY
            ITEM_CODE
        HAVING
            TOTAL >= 50
    ) OD ON S1.ITEM_CODE = OD.ITEM_CODE
    LEFT JOIN ITEM IT ON OD.ITEM_CODE = IT.ITEM_CODE
WHERE
    WH.WH_NAME = '浦和倉庫'
ORDER BY
    SUM_QTY DESC, CODE DESC
提出情報
提出日時2024/06/07 13:27:13
コンテスト第1回 SQLコンテスト初級編
問題売れ筋商品
受験者nocopylight
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量87 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
87 MB
データパターン2
WA
87 MB