tahirih
asked on
Access - Deduplicate on multiple fields
I have attempted to use a SELECT DISTINCT query on, de-duplicating on three fields, without success.
I have a table, with the following three fields:
Favorite_Shoe Last_Name First_Name
I want to de-cuplicate records, based on unique values of all three fields, using a SQL DISTINCT query
Thanks
I have a table, with the following three fields:
Favorite_Shoe Last_Name First_Name
I want to de-cuplicate records, based on unique values of all three fields, using a SQL DISTINCT query
Thanks
ASKER
I get an extra [Expression Column]
I am also comparing these results with a De-Duplicate in Excel, and am not getting the same results.
Please advise, and how to not include the [Expression]
Thanks
I am also comparing these results with a De-Duplicate in Excel, and am not getting the same results.
Please advise, and how to not include the [Expression]
Thanks
ASKER
Additionally, I would like to include additional fields in the table other than the thre De-Dup fields.
Thanks
Thanks
ASKER
Is there a ways to obtain Distinct Records based on the columns above, but if there are additional columns, include them in the output table?
For instance, my table has 5 columns, 3 of which will be included in the "DISTINCT" SQL programming. The solution may be the proper placement of an *, but all attempts I have made have not been successful.
Thanks.
For instance, my table has 5 columns, 3 of which will be included in the "DISTINCT" SQL programming. The solution may be the proper placement of an *, but all attempts I have made have not been successful.
Thanks.
what happen when you add the other fields
select distinct [Favorite_Shoe] & [Last_Name] & [First_Name], Favorite_Shoe, Last_Name,First_Name,Field 4,field5
from tableX
select distinct [Favorite_Shoe] & [Last_Name] & [First_Name], Favorite_Shoe, Last_Name,First_Name,Field
from tableX
ASKER
I continue to get unwanted "Expr" fields. The Query inlcludes the non-dedup fields (i.e Field4 or Field5) as part of what is being used in De-Duplication.
Thanks
Thanks
tahirih,
attach your db.
check Attach File below. if db >4 mb. zipped it
attach your db.
check Attach File below. if db >4 mb. zipped it
ASKER
what do you want to do with the duplicates?
does your Access table have a unique recordID?
ASKER
At this time, I am not interested in keeping the duplicates. However, if you have a SQL coding method to export the duplicates into a new table, this is appreciated.
No, there is not a RecordID.
Thanks
No, there is not a RecordID.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I thank you for this.
I did come across this link myself. However, I am particular on obtaining SQL code.
I did come across this link myself. However, I am particular on obtaining SQL code.
select distinct [Favorite_Shoe] & [Last_Name] & [First_Name], Favorite_Shoe, Last_Name,First_Name
from tableX