怎么合并表
select MONTH(a.SummaryDate) as Date,
SUM(a.RevenueMoney) as AllMoney
FROM (select summarydate,revenueMoney from dbo.Summary
WHERE YEAR(a.SummaryDate)='2012' and
a.SId = '001' union all
select summarydate,revenueMoney from dbo.summary_1
WHERE YEAR(a.SummaryDate)='2012' and
a.SId = '001' union all
select summarydate,revenueMoney from dbo.summary_2
WHERE YEAR(a.SummaryDate)='2012' and
a.SId = '001')
AS a
GROUP BY
MONTH (a.SummaryDate)
order by (Date) desc