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;
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--大概就这样
(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