반응형 [LeetCode] 196.Delete Duplicate Emails 문제 테이블 내에 이메일이 중복되는 데이터가 있다면, id가 가장 작은 데이터만 출력하는 쿼리를 작성하라 정답 -- 본인 풀이 delete from person where id not in ( select id from ( select min(id) as id, email from person group by email ) as A ) -- 문제풀이 delete p1 from person p1,person p2 where p1.email=p2.email and p1.id>p2.id; 2023. 2. 6. 이전 1 다음 반응형