3
Reply

TWO Queries

Sreekanth

Sreekanth

Apr 23 2009 4:54 AM
2.3k

sum of two Queries
i acn use
select a,b,c from ABC
unoin
select a,b,c from DEF

is there any method other than following. to ADD values of above queries
ie 1ineed output in a+a,b+b,c+c
iget result by

select sum(t.a),sum(t.b),sum(t.c) from(select a,b,c from ABC
unoin
select a,b,c from DEF
)as t

and select a+(select a from DEF),b+(select b from DEF),c+(select c from DEF) from ABC

 above two  gives result but in my case its not correct help me pls???


Answers (3)
Next Recommended Forum