- 記載したクエリで実現できるもののもっとスマートな書き方を知りたいです。
sql
1select now.shopcd, now.shopnm, now_sales, past_sales 2from 3( select shopcd, shopnm, sum(amt) AS now_sales 4 from sales 5 where ymd between '20170801' and '20170831') as now 6 7inner join 8 9( select, shopcd, shopnm, sum(amt) AS past_sales 10 from sales 11 where ymd between '20160801' and '20160831') as past 12 13on now.shopcd=past.shopcd
回答1件
あなたの回答
tips
プレビュー