Re: How to remove rows where only part of the row is duplicated
Posted by markc600 on 02/02/07 09:08
There isn't really any 'first' instance unless you
define your own ordering. However, assuming you have a unique ID
column
this should work
SELECT a.Postcode, a.Town, a.latitude, a.longitude
FROM Postcode a
WHERE NOT EXISTS (SELECT * FROM Postcode b
WHERE b.Postcode=a.Postcode
AND b.Town=a.Town
AND b.ID>a.ID)
ORDER BY a.Postcode, a.Town