ソースコード
-- with st as(
-- select
-- orders.*
-- from orders join warehouse
-- where warehouse.wh_name = '浦和倉庫'
-- )

with st as (select 
*
from orders where wh_code = (select wh_code from warehouse where wh_name = '浦和倉庫')
)
, st2 as (select 
orders_dtl.ITEM_CODE as CODE
, SUM(orders_dtl.ORDER_QTY) as SUM_QTY
from st join orders_dtl on st.order_no = orders_dtl.order_no 
group by CODE
having SUM_QTY >= 50
order by SUM_QTY desc, CODE desc
)
select 
st2.CODE as CODE
, item.ITEM_NAME as NAME
, st2.SUM_QTY as SUM_QTY
from st2 left join item on st2.code = item.item_code
order by SUM_QTY desc, CODE desc
提出情報
提出日時2024/06/10 00:10:17
コンテスト第1回 SQLコンテスト初級編
問題売れ筋商品
受験者daku10
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量89 MB
メッセージ
テストケース(通過数/総数)
2/2
状態
メモリ使用量
データパターン1
AC
85 MB
データパターン2
AC
89 MB