ソースコード

select
    b.item_code as CODE,
    c.item_name as NAME,
    sum(b.unitprice * b.order_qty) as TOTAL_AMT
from orders as a
inner join orders_dtl as b
on
    a.order_no = b.order_no
    and
        --julianday(a.order_date) between julianday('2023-05-14') and julianday('2023-05-20')
        (a.order_date = '2023-05-14'
        or a.order_date = '2023-05-15'
        or a.order_date = '2023-05-16'
        or a.order_date = '2023-05-17'
        or a.order_date = '2023-05-18'
        or a.order_date = '2023-05-19'
        or a.order_date = '2023-05-20')
        
left outer join item as c
using(item_code)
group by 1, 2
order by 3 desc, 1 desc
limit 5;
提出情報
提出日時2023/06/17 14:08:38
コンテスト第7回 SQLコンテスト
問題受注金額TOP5
受験者miotsukushi0800
状態 (詳細)AC
(Accepted: 正答)
メモリ使用量83 MB
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
80 MB
データパターン2
AC
82 MB
データパターン3
AC
83 MB