1. Deteksi value yang dobel.
SELECT book_title, COUNT(*) c FROM `book` GROUP BY book_id HAVING c > 1;
2. Hapus salah satu value yang dobel.
DELETE n1 FROM book n1, book n2 WHERE n1.book_id > n2.book_id AND n1.book_title = n2.book_title;
3. That's it.
No comments:
Post a Comment