I think this should require nothing more then just grouping by all columns except the id and choosing one row from every group - for simplicity just the first row, but this does not actually matter besides you have additional constraints on the id.
Or the other way around to get rid of the rows ... just delete all rows accept a single one from all groups.