Possible Duplicate:
SQL - How can I remove duplicate rows?
Deleting duplicate rows from a table
Here's my case
I have a table named result who look like this
Id Valeur IdUtilisateur Date IdUnit IdMea IdAnalyte
1 0.440 patlach01 2012-01-02 2 39258 2541
2 0.440 patlach01 2012-01-02 2 39258 2541
3 0.440 patlach01 2012-01-02 2 39258 2541
As you see I have similar rows but different id
(Identity set to yes so id
increase auto)
I want to delete unneeded rows but keep only 1 sample
IdUnit
, IdMea
, IdAnalyte
are fk for other tables
How can I do this?
And I would like to make it for all others case (yes the bd is a mess,a LOT of duplicates) so I want to be "generic' and do the job in 1 operation (if possible)
Sorry if I'm not clear enough,this is my first post here!!!!