各位大虾,可以帮助小弟判断一下以下两种方法哪个的效率更高吗?
一、
Select C,sum(A) as SA
From(
Select T1.C,sum(T1.A) as A From T1
Group by T1.C
Union All
Select T2.C,sum(T2.A) as A From T2
Group By T2.C
) as UV
Group By C
二、
Select C,sum(A) as SA
From (
Select T1.C,T1.A From T1
Union All
Select T2.C,T2.A From T2
) as UV
Group By C