-- mysql删除重复记录
DELETE
FROMganji_info
WHERE
id NOT IN (
SELECT
*
FROM
(
SELECT
id
FROM
ganji_info
GROUP BY
address
) b
);
--------------------------------------------------------------------/
-- mysql查询重复记录
SELECT
*
FROM
ganji_info a
WHERE
NOT EXISTS (
SELECT
1
FROM
ganji_info b
WHERE
b.address = a.address
AND b.id < a.id
)