ソースコード
with note as (select 
* from item
where not exists (select 1 from stock where stock.item_code = item.item_code)
)
, nl as (
select item_code from stock where last_delivery_date is null
)
, old as (
select 
item_code
, max(last_delivery_date) as ml
from stock
where item_code not in (select item_code from nl)
group by item_code
)
, dold as (
select item_code from old where ml <= date('2023-06-01', '-6 month')
)
delete from item where stock_management_type = 1 and (item_code in (select item_code from note) or item_code in (select item_code from dold))
提出情報
提出日時2024/05/05 14:24:22
コンテスト第7回 SQLコンテスト
問題商品整理
受験者daku10
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量84 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
84 MB
データパターン2
WA
83 MB