版權聲明:本文首發 http://asing1elife.com ,轉載請注明出處。 https://blog.csdn.net/asing1elife/article/details/82892848
資料庫中如果插入重複記錄,需要有效排查出重複結果
更多精彩
- 更多技術部落格,請移步 asing1elife’s blog
方法
SELECT
*
FROM
pt_university_institute_staff
WHERE
staffId IN (
SELECT
co.staffId
FROM (
SELECT
staffId, count(*) AS count
FROM
pt_university_institute_staff
GROUP BY
staffId
HAVING
count > 1
) co
);