Select di

  • Thread starter Thread starter elsverfaillie
  • Start date Start date
E

elsverfaillie

Guest
Hi,

I have a table with 5000 samples ("samples"). It contains X,Y coordinates and values for the coordinates. The coordinates are numbers (e.g. X: 456812, Y:5264874). My database contains a lot of records with duplicate X values. For further processing, I have to remove those records. I thought I could remove them with:

SELECT DISTINCT x
FROM samples

This doesn't seem to work.
Any suggestions?

Thank you!
Els
 
Try:
Code:
DELETE S1.*
FROM samples AS S1
WHERE S1.X IN (
    SELECT S2.X
    FROM samples AS S2
    GROUP BY S2.X
    HAVING Count(S2.X)>1;
);
 
there is also a "find duplicates" in the query wizard
 

Users who are viewing this thread

Back
Top Bottom