delete from employee where objuid in (
SELECT
objuid
FROM
(
SELECT
objuid
FROM
employee
WHERE
wx_id IN (
SELECT
wx_id
FROM
employee
GROUP BY
wx_id
HAVING
count(*) > 1
)
AND objuid NOT IN (
SELECT
min(objuid)
FROM
employee
GROUP BY
wx_id
HAVING
count(*) > 1
)
ORDER BY
user_name
) a)
网友评论