Francisco
asked on
sybase sql - how to sum up UNION records
I like to sum up two sql results into one in one shot.
there are two tables, both has same columns but data records are different
I would like to see one line result as total sum value instead of two lines.
select
key,
sum(columnA)
from table A
group by key
UNION
select
key,
sum(columnA)
from table B
group by key
would you advise how this can be made...?
there are two tables, both has same columns but data records are different
I would like to see one line result as total sum value instead of two lines.
select
key,
sum(columnA)
from table A
group by key
UNION
select
key,
sum(columnA)
from table B
group by key
would you advise how this can be made...?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER