Combine the Unique data

R

Ranjit kurian

Hi

I have one table (Detail) and one query (AGE), i need a query to combine the
data of Detail and Age, as shown below.

Detail table looks like below

Name TOTAL AMT
a 1
b -1
c 2

AGE query results looks like below

Name TOTAL AMT
a 1
f 3
c 2

Combine query results should look like below

Name TOTAL AMT
a 1
b -1
f 3
c 2
 
C

colin_e

This is exactly what a UNION query is for.

Try something like-

SELECT * FROM Detail
UNION
SELECT * FROM Age;

The UNION automatically removes duplicate rows.
 
Top