3 个解决方案
#1
select a.* from student a left join student b on a.name = b.name and a.id <> b.id order by a.name
#2
select name from student group by name having count(name)>1
#3
不过看楼主还要取什么数据了。如果需要详细信息,用1楼的好了。这个只能看到那些名字的不只一个学生。看不到详细信息
#1
select a.* from student a left join student b on a.name = b.name and a.id <> b.id order by a.name
#2
select name from student group by name having count(name)>1
#3
不过看楼主还要取什么数据了。如果需要详细信息,用1楼的好了。这个只能看到那些名字的不只一个学生。看不到详细信息