Or
with temp1(sumsales) as
(
select sum(sales) from tabl1
union all
select sum(sales) from table2
)
select sumsales from temp1
I think this will make a difference if the table is large ... Probably it may not require to create a large temp table ...
(This is just my thought ... Untested one)
Cheers
Sathyaram
Quote:
Originally posted by ARWinner
Grofaty,
How about something like:
with temp1 (sales) as
(select sales from table1 union all select sales from table2)
select sum(sales) from temp1
Andy
|