Sarangadhar Beginner
Joined: 14 Oct 2004 Posts: 130 Topics: 43 Location: virtual village
|
Posted: Mon Apr 09, 2007 3:03 pm Post subject: UNION SUM |
|
|
Hi,
I have data in 3 tables. I need to sum up a column from three tables. If the matching row presents, sum the column in all tables, or sum in the tables wherever it is present.
SELECT AMOUNT1
FROM TABLE1
SELECT AMOUNT2
FROM TABLE2
SELECT AMOUNT3
FROM TABLE3
from the above 3 queries, if amounts are present in all tables for a particular criteria, i need them to add. if present in only one, i just need to pick and sum wherever the are present and create a single row in resultant table. _________________ Thanks |
|