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 )
例如:查询学生表(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 )