Union SQL (1 Viewer)

paulcherianc

Registered User.
Local time
Today, 06:49
Joined
Aug 15, 2013
Messages
86
Dear Experts!

From the below SQL Query i need to get the unique records. Could anyone help me !:rolleyes:

SELECT [Cost Center],[Employee Backcharge]
FROM [Accommodation Module-6-LRT Employee Backcharge by Cost Center 2];
UNION
SELECT [Cost Centers],[Sum of Total Amount]
FROM [Accommodation Module-6-LRT Project Backcharge by Cost Center];
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 23:49
Joined
Jan 20, 2009
Messages
12,856
A UNION should already remove duplicates of records that are in both queries suggesting that you have repeats in the source tables or queries.

Put DISTINCT after SELECT in both queries.
 

Users who are viewing this thread

Top Bottom