sql笔试题三表联查求解

2025-02-26 13:11:37
推荐回答(1个)
回答1:

select sum (m.order_price) from (select * from sellorders m ,(select * from branch b, storehouse n where b.branch_id = n.branch_id)t where m.store_id = t.store_id and m.delivery_state = 15 and (m.order_price>500) and (date(m.order_time) between '2015-03-01' and '2015-03-31') and b.branch_id = ?)
传个分公司ID参数就能查到这个公司的了。