开发者

How can I remove duplicate records in Access only if all fields match?

开发者 https://www.devze.com 2023-02-18 06:07 出处:网络
I have a tabl开发者_如何学JAVAe that unfortunately has many duplicates.Here is a small example:

I have a tabl开发者_如何学JAVAe that unfortunately has many duplicates. Here is a small example:

Name | Location

Mike | New Jersey

Mike | Ohio

Brian | Ohio

Mike | New Jersey

How can I only remove dups on the Mike | New Jersey lines? I'm having trouble making sure all fields match and not just Name. So my end result would be:

Name | Location

Mike | New Jersey

Mike | Ohio

Brian | Ohio


Easier to do that in two steps:

  1. Create a table without duplicates
  2. Truncate original table and load data from table you just created

To create a Query that will remove duplicates, use Group By. E.g.

SELECT Name,Location
FROM TABLE_NAME
GROUP BY Name,Location
0

精彩评论

暂无评论...
验证码 换一张
取 消