All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
查询表里面有N组相同的记录经典SQL语句_[SQL Server教程]

Writer: 归海一刀 Article type: Programming skills(编程技巧) Time: 2014/2/3 6:46:29 Browse times: 424 Comment times: 0

查询表里面有N组相同的记录经典SQL语句_[SQL Server教程]


Head photo

Go homepage
Upload pictures
Write articles

查询表里面有N组相同的记录经典SQL语句_[SQL Server教程]

表里面有N条相同的记录,要查出来.

如:
ID Name
12 d
34 e
543 t
34 e
12 d
45 y
543 t

查询的结果应为:
ID Name
12 d
12 d
34 e
34 e
543 t
543 t

假如表名为Table03,可以用下面语句轻松实现:

select id,name from table03 where name in(select name from table03 group by name having count(name)>1)





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.