select 学生,count(*)
from T
group by 学生
select *
from T
where 学生 in (select 学生
                 from T
             group by 学生
               having count(*) >1)
order by 成绩 desc

解决方案 »

  1.   

    1  Select distinct * From  table
    Where 学生 in
            (select 学生  from table   group by 学生
          having count(*) > 1)
    2 Select * From  table
    Where 学生 in
            (select 学生  from table   group by column
          having count(*) > 1)
    order by 成绩 desc
      

  2.   

    SELECT 学生,成绩
    FROM tablename
    GROUP BY 学生,成绩
    HAVING COUNT(*)>1
    SELECT DISTINCT 学生,成绩
    FROM tablename
    ORDER BY 成绩
      

  3.   

    1.select * from tablename a where exists(select * from tablename b where a.学生=b.学生and a.成绩=b.成绩)
    2.select * from tablename a where exists(select * from tablename b where a.成绩=b.成绩) order by 成绩
      

  4.   

    sorry!
    1.SELECT 学生,成绩 FROM tablename GROUP BY 学生,成绩 HAVING COUNT(*)>1
    2.Select * From  table
    Where 学生 in (select 学生  from table   group by column having count(*) > 1)
    order by 成绩 desc
      

  5.   

    Select distinct * From  table
    Where 学生 in
            (select 学生  from table   group by 学生
          having count(*) > 1)
      

  6.   

    1.SELECT 学生,成绩 FROM tablename GROUP BY 学生,成绩 HAVING COUNT(*)>1
    2.Select * From  table
    Where 成绩 in (select 成绩  from table   group by 成绩 having count(*) > 1)
    order by 成绩 desc
      

  7.   

    1: Select 学生,成绩 from 表 group by  学生,成绩 having count(*) > 1
    2: Select 学生,成绩 from 表 where 成绩 in (Select 成绩 from 表 group by 成绩 having count(*) > 1)
      

  8.   

    这个也可:1: Select 学生,成绩 from 表 group by  学生,成绩 having sum(1)> 12: Select 学生,成绩 from 表 where 成绩 in (Select 成绩 from 表 group by 成绩 having sum(1)>1) order by 成绩 desc
      

  9.   

    第一个问题:
    select 学生,成绩 from (select 学生,成绩,count(学生) as num from tmp1 group by 学生,成绩) b where b.num>1
    第二个问题:
    select * from tmp1 a inner join 
    (select 成绩 from (select 成绩,count(成绩) as num from tmp1 group by 成绩) b where b.num>1) c
    on a.成绩=c.成绩 order by a.成绩 desc