Union Query Issue

haydenal

Registered User.
Local time
Today, 08:27
Joined
Jan 8, 2009
Messages
52
I have a 2 queries set up each with identical field names, one that returns 110 records and the other that returns 207 records. I have set up a 3rd union query that looks like "SELECT * FROM Query1 UNION SELECT * FROM Query2;". This query return 315 records when I'm expecting 110 + 207. Is there an easy way to track down which 2 records are missing or are there considerations that would make this easier if my goal is to just lump the records from the 2 queries in to a 3rd?
 
They be duplicates between the two tables... Use "Union ALL" to not filter out the duplicates.
 
Thanks for the response!

I tried that and it yields me 319. I'm confused. :o
 
Then your numbers "should" be wrong... Union ALL doesnt do anything but append all data together...

Union de-dups it... but union all just concatinates... you are sure about your numbers?
 
I ran query 1 again and low and behold 112 records were returned (I'm running the query on a live database so this makes sense). I ran the union all again and everything is as I expect.

You're awesome!

Thanks Again!
 

Users who are viewing this thread

Back
Top Bottom