SQL: Remove duplicate rows that have different ids