SQL Help

Soldato
Joined
27 Sep 2004
Posts
11,200
Location
The Ledge Beyond The Edge
Hi,

I have the following query in order to check for duplicates in a table
Code:
SELECT MAX(ID) as PONumber FROM [PurchasesTemp]
GROUP BY PONumber
Having Count(*) > 1

The problem is, if there are multiple duplicates, it only returns the last one?

Is there a way i can change it so it will return all the duplicates?

Cheers
 
Sorry, The ID is a unique number, but what is duplicates is PONumber.

In your code, what would i use for [other]?
 
I think the issue is in the SELECT MAX(ID) part. I assume that is only giving me the ID which is the highest one and not all the ID's?
 
Back
Top Bottom