各位大佬,望闲暇时间指点一下

like_a_cat 2018-03-20 03:29:54
...全文
658 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_36611253 2018-03-21
  • 打赏
  • 举报
回复
1个仓库有两个分公司共用的话、那你怎么确定这个仓库的订单金额是哪个公司的、订单表里应该少一个分公司id字段吧 select c.branch_name,concat(round(a.total/10000,2),'万') from (select store_id,sum(order_price)as total from sellorders where delivery_state = 15 and to_char(order_time,'yyyy-mm')='2015-03' group by store_id having sum(order_price)>500)a inner join storehouse b on a.store_id=b.store_id left join branch c on b.branch_id=c.branch_id
liu志坚 2018-03-20
  • 打赏
  • 举报
回复
sum(so.order_price)/10000 total
liu志坚 2018-03-20
  • 打赏
  • 举报
回复
sum(so.order_price/10000) total
liu志坚 2018-03-20
  • 打赏
  • 举报
回复
select br.branch_name, sum(so.order_price) total from sellorders so, storehouse sh, branch br where so.store_id = sh.store_id and sh.branch_id = br.branch_id so.delivery_state = 15 and so.order_time >= to_date('20150301', 'YYYYMMDD') and so.order_time < to_date('20150401', 'YYYYMMDD') and so.order_price > 500 group by br.branch_name;
花开了叫我 2018-03-20
  • 打赏
  • 举报
回复
SELECT a.branch_id,round(SUM(c.order_price)/10000,2) FROM branch a,storehouse b,sellorders c WHERE a.branch_id = b.branch_id AND b.store_id = c.store_id AND c.order_time >= to_date('20150301','yyyymmdd') AND c.order_time < to_date('20150401','yyyymmdd') AND c.delivery_state=15 AND c.order_price>500 GROUP BY a.branch_id --大概就这样

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧