请教一个简单sql语句问题:怎么能够查出一个表里的重复的各条数据呀!谢谢了

siling99 2007-01-06 10:53:26
例如:表里的数据是 1 1 2 3 3 3
查询后显示的结果为: 1 1 3 3 3
谢谢了
...全文
159 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
liujia_0421 2007-01-06
  • 打赏
  • 举报
回复
test:


create table test(id int)

insert into test values(1)
insert into test values(1)
insert into test values(2)
insert into test values(3)
insert into test values(3)
insert into test values(3)

select * from test where id in (select * from test group by id having (count(id)>1));
liujia_0421 2007-01-06
  • 打赏
  • 举报
回复
for example:

select * from test where id in (select * from test group by id having (count(id)>1));

110,566

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧