• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1203
  • Last Modified:

Not Distinct in a UNION query

I'm stitching together QUERY1 and QUERY2  with a UNION query (QUERY3).
In QUERY1 there are several identical records.
After the UNION several records have been left out, and there are now no identical records.

How can I fix this?

Arild
0
arildj78
Asked:
arildj78
  • 2
2 Solutions
 
nico5038Commented:
Try:

select * formquery1
UNION ALL
select * from query 2

Nic;o)
0
 
Pigster14Commented:
Try UNION ALL instead
0
 
nico5038Commented:
Hmm should learn t type better, the query should be:
select * from query1
UNION ALL
select * from query2;

A "normal" UNION will sort the rows and eliminate the duplicates.

Nic;o)
0
 
arildj78Author Commented:
That did it :)   Thanks
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now