Problem with Union Query

raghavcacs

Board Regular
Joined
Mar 13, 2009
Messages
84
Hi i have a union query which picks data from a table and gives me a report.

Total no.of records has to be 400000 rows, but it is showing some where around 360000 rounds, 40000 rows are missing. I don't have any clues on this.

Can any one help me on this?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I believe that Union Queries automatically drop all records which are exact duplicates of other records.

Do you have duplicates in there (when considering all fields)?
Do you not want it to remove duplicates?
 
Upvote 0
Joe,
I suspected about duplicates. Yes, It has duplicates in 10 fileds out of a total of 15 fields. But these 10 fields are the deciding factor.

Actually the union query is to convert columns in to rows. The rows deciding factors are those 10 fields.

I want to have the duplicates also. Is there any way?
 
Upvote 0
Upvote 0
To include duplicates in a Union Query use the ALL keyword ie..

SELECT name, price, warranty_available, exclusive_offer
FROM Products
UNION ALL
SELECT name, price, guarantee_available, exclusive_offer
FROM Services;
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top