急急急急急!高手帮忙啊! select * from table1 where id in (select id from table1 group by id having count(*) > 1) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select 字段名 from t group by 字段名 having count(1)>1 select * from table1 a where id in (select id from table1 id=a.id and other<>a.other)楼主的意思是要所有重复得记录吧,上面的other为你的一个并不重复的其他字段 select * from 表 a join (select 某个重复字段,count(某个重复字段) as idd from 表 group by 某个重复字段 having count(某个重复字段)>1) bon a.某个重复字段=b.某个重复字段 或者select * from 表 a where exists (select 1 from 表 where 某个重复字段=a.某个重复字段 group by 某个重复字段 having count(某个重复字段)>1) select * from T awhere (select count(*) from T where 某个重复字段 = a.某个重复字段) > 1 谢谢各位,已经搞定了,用的是exist 请问这个怎么写?谢谢 有请SQL高人下天山 HELP ME!!!!!此题好象比较复杂,顶者有分 如何防止SQL事务并发时,造成数据错乱的问题 SQL写入遇到的问题 大家帮我看看这个三张表的关系,英文的不太看的懂哎~~谢谢!!! 请教:把getdate()变成YYYYMM的格式,怎么写?有没有已知函数? 用VB调用SQL问题!! 在数据库中执行一个查询操作,应包括哪些步骤?(在线等待) 我在更新备注类型字段时遇到的问题 sql server 2000 sqlserver服务器时间问题 请教一个简单的OR和AND的问题 请教一个查询最新交易价格的问题
select * from table1 a where id in (select id from table1 id=a.id and other<>a.other)楼主的意思是要所有重复得记录吧,上面的other为你的一个并不重复的其他字段
(select 某个重复字段,count(某个重复字段) as idd from 表
group by 某个重复字段 having count(某个重复字段)>1
) b
on a.某个重复字段=b.某个重复字段
select * from 表 a
where exists (select 1 from 表 where 某个重复字段=a.某个重复字段
group by 某个重复字段 having count(某个重复字段)>1)
from T a
where (select count(*) from T where 某个重复字段 = a.某个重复字段) > 1