UNION Query

aftabn10

Registered User.
Local time
Today, 16:13
Joined
Nov 4, 2008
Messages
96
Hi,

I have ran the following query to combine 2 query results, but i get duplicate data showing up. I have duplicate ID (1,1,2,2) and Names as well. I was aware that if i take the ALL out the Union this would combine the duplicates into 1 line, but this hasnt worked. Where have i gone wrong.

SELECT *
FROM [IKON WE061109]
UNION SELECT *
FROM [Manual WE061109];

Could somebody please help. Thanks in advance.
 
No duplicate records should be returned, so presumably there are other fields being returned that make the records in question unique. If you can specify those two fields instead of "*", the duplicates should be eliminated.
 
Yeah something like

SELECT [IKON WE061109].<fieldName> as Field1
FROM [IKON WE061109]
UNION SELECT [Manual WE061109].<fieldName> as Field1
FROM [Manual WE061109];

would work.
 

Users who are viewing this thread

Back
Top Bottom