Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternative to SQL UNION Query 1

Status
Not open for further replies.

jamie81

Programmer
Aug 28, 2001
12
0
0
US
I have two queries that I need to combine into one query using a sql statement. A UNION query would work like a charm, except that it automatically eliminates any rows with duplicate data.

How do I combine the results of two queries, based on matching columns, without deleting duplicate data?
 
Add the ALL keyword:

SELECT * FROM Yin
UNION ALL
SELECT * FROM Yang


Joe Miller
joe.miller@flotech.net
 
grrrrr.... try this instead


SELECT * FROM Yin
UNION ALL
SELECT * FROM Yang Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top