SELECT
*
FROM
people
WHERE
people_no IN (
SELECT
people_no
FROM
people
GROUP BY
people_no
HAVING
count(people_no) > 1
);
SELECT
*
FROM
people
WHERE
people_no IN (
SELECT
people_no
FROM
people
GROUP BY
people_no
HAVING
count(people_no) > 1
)
AND id NOT IN (
SELECT
min(id)
FROM
people
GROUP BY
people_no
HAVING
count(people_no) > 1
);
SELECT
*
FROM
people a
WHERE
(a.people_no, a.people_name) IN (
SELECT
people_no,
people_name
FROM
people
GROUP BY
people_no,
people_name
HAVING
count(*) > 1
);
SELECT
*
FROM
people a
WHERE
(a.people_no, a.people_name) IN (
SELECT
people_no,
people_name
FROM
people
GROUP BY
people_no,
people_name
HAVING
count(*) > 1
)
AND a.id NOT IN (
SELECT
min(id)
FROM
people
GROUP BY
people_no,
people_name
HAVING
count(*) > 1
);