两个数据表相加的SQL代码

select pid,sum(a.innum)
from 
( select * from pinto
union
select * from pout ) a
group by a.pid

  

posted @ 2015-03-23 17:03  vov5601  阅读(439)  评论(0编辑  收藏  举报