sql语句:查询表中字段值相同的记录

例如:查询学生表(student)中名字(name)相同的记录:

  select * from  student s1 where exists ( select * from student s2 where s1.name = s2.name group by s1.name having count(s1.id) >1 )

posted @ 2015-01-09 11:46  lusunlufar  阅读(887)  评论(0编辑  收藏  举报