DELETE school_students_base
FROM
school_students_base,
(
SELECT
min(id) id,
certificates_number
FROM
school_students
GROUP BY
certificates_number
HAVING
count(*) > 1
) t2
WHERE
school_students_base.certificates_number = t2.certificates_number
AND school_students_base.id > t2.id
网友评论