当前位置: 数据库>sqlserver
SQL语句查询数据库中重复记录的个数
来源: 互联网 发布时间:2014-09-05
本文导语: 代码如下:select a,b,c,count(*) from (select c.a,c.b,c.c from test c) having count(*) >= 2 group by a,b,c 或者 代码如下:select zdbh,tdzl,zdmj,count(*) from ecaadmin.zdsx group by zdbh,tdzl,zdmj having count(*) >= 2
代码如下:
select a,b,c,count(*) from (select c.a,c.b,c.c from test c) having count(*) >= 2 group by a,b,c
或者
代码如下:
select zdbh,tdzl,zdmj,count(*) from ecaadmin.zdsx group by zdbh,tdzl,zdmj having count(*) >= 2