❤️SQL数据库查询出一张表中重复的数据,按某个字段来查找

小明的学习圈子2023-08-12数据库总结

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

1

Last Updated 2024/4/6 10:47:15