--try
select 字段 from 表
group by 字段
where having count(字段)>1
select 字段 from 表
group by 字段
where having count(字段)>1
解决方案 »
- 求条sql语句 急等
- 问一个关于PB7 连接 SQL 2005的问题
- sql前嵌套查询问题
- 如何让表根据自己表中的一个字段进行排序?
- update失误后用什么脚本命令可以恢复到update以前的状态。请高手指点
- NetBeans连不上Mysql,下载了驱动也不行。电脑64位win7
- 使用ETL 我用存储过程或别的啥都可以实现其功能,为啥要用ETL啊
- 求一查询语句。
- 能不能根据某两个表的关系,(例如xxID=yyID),在另外一个表中建立多个记录,
- 帮看看以下sql语句内参数的意思
- sql server隐式连接的问题(解决重谢)
- 事务明明是回滚了,怎么会提交,下面是我在事务探查器中找到的语句,没有触发器
insert into @t
select '1','a' union all
select '1','b' union all
select '1','c' union all
select '2','e' union all
select '3','f' union all
select '3','g'
------------------------------
select * from
(select id from @t
group by id having count(*)>1) a
left join @t b
on a.id=b.id
id id name
----------- ----------- ----------
1 1 a
1 1 b
1 1 c
3 3 f
3 3 g(影響 5 個資料列)