SQL数据库查询出一张表中重复的数据,按某个字段来查找。
SELECT
V.NUM_ID,
V.XM
FROM
t_MID_RS_PARTY V
WHERE
V.ZGH IN ( '060002', '100178', '120283' ) SELECT
V.ZGH
FROM
t_MID_RS_PARTY V
GROUP BY
V.ZGH
HAVING
COUNT( V.ZGH ) > 1
结果
SQL数据库查询出一张表中重复的数据,按某个字段来查找。
SELECT
V.NUM_ID,
V.XM
FROM
t_MID_RS_PARTY V
WHERE
V.ZGH IN ( '060002', '100178', '120283' ) SELECT
V.ZGH
FROM
t_MID_RS_PARTY V
GROUP BY
V.ZGH
HAVING
COUNT( V.ZGH ) > 1
结果