Tambahkan Indeks Unik di meja Anda:
ALTER IGNORE TABLE `TableA`
ADD UNIQUE INDEX (`member_id`, `quiz_num`, `question_num`, `answer_num`);
Cara lain untuk melakukannya adalah:
Tambahkan kunci utama di tabel Anda maka Anda dapat dengan mudah menghapus duplikat dari tabel Anda menggunakan kueri berikut:
DELETE FROM member
WHERE id IN (SELECT *
FROM (SELECT id FROM member
GROUP BY member_id, quiz_num, question_num, answer_num HAVING (COUNT(*) > 1)
) AS A
);