Not Show Duplicates?

  • Thread starter Thread starter Dustin Swartz
  • Start date Start date
D

Dustin Swartz

I can very easily put together a "find duplicates query" that shows me all
of my duplicates.

Now How can I build a query that will only show the first instance of the
data and not the duplicates?

Thank you!
 
If you have the primary key in the duplicates query, then you can use something like

SELECT * FROM YourTable
WHERE YourTable.PrimaryKey IN (
SELECT Max(PrimaryKey)
FROM QueryDuplicates
GROUP BY <ListTheFieldsUsedToDetermineDuplicates>)

Depending on the fields you are showing in the duplicates query, you might just
be able to add Distinct to it to get distinct values across the rows.
Obviously, in this case you cannot show the Primary Key.

Or you can use a totals/group by query and group by the fields that determine
the duplicates and show the First of all the other fields.

IF you want a less generic set of instructions, post your SQL.

(Possibly unneeded instructions follow)
Open the query
Select View:Sql from the Menu
Select all the text
Copy it
Paste it into the message
 
Back
Top