How to use DISTINCT and UNION?

时间:2016-04-04 16:46:07

标签: ms-access

My company imports data from a shared data warehouse into excel. The imported data is spread into 2 worksheets because of the number of rows (100,000). Both worksheets have exact same fields/column headings.

What I've done is created 2 linked tables in access to the 2 worksheets. I've created a union query using UNION ALL to merge both tables into one. There is a field called "current ID". I have split that field into 2 using left() and right() functions to get "case number" and "person number".

Now my question is, how can I make the above table with only distinct values in one field only. i.e. I want all the records where the field "case number" is only distinct values.

I tried using UNION instead of UNION ALL but same result because every record is unique.

I want all columns but have DISTINCT applied only to the "case number" field.

Any help would be appreciated.

0 个答案:

没有答案
相关问题