表如下
学号  姓名  成绩
1     a      55
2      a      99
3      c      77
4      c      88
5      c      99
6      e      88
如何将相同姓名的学生列出来
一个学号对应一个姓名的不列出来

解决方案 »

  1.   

    Select * FROM 表 
    Where 姓名 IN
    (Select 姓名 FROM 表
    Group by 姓名
    having count(姓名)>1)
      

  2.   

    select * from table1 where 姓名 in 
    (select 姓名 from 
    (select count(*) as icount ,姓名 from table1 group by 姓名) xx where icount =1)
      

  3.   

    用这个>>
    select a.* from table a 
    inner join table b on a.姓名=b.姓名 and a.学号<>b.学号
      

  4.   

    一个人有多个学号???
    slect 学号 from (select 学号,count(姓名) a from table group by 姓名) x  where a > 1
      

  5.   

    不好意思 应该是:
    slect 姓名 from (select 姓名,count(姓名) a from table group by 姓名) x  where a > 1