2,596
社区成员
发帖
与我相关
我的任务
分享
select a.acc_no, state, country, institution, b.maxvalue, b.total, c.maxvalue2, c.total2
from account a,(select acc_no, max(init_date) as maxvalue, sum(amount) as total from quotation group by acc_no) b,
(select acc_no, max(order_date) as maxvalue2, sum(total_price) as total2 from order_main group by acc_no) c
where a.acc_no=b.acc_no and a.acc_no=c.acc_no and a.acc_no>20000