select 学生,count(*)
from T
group by 学生
select *
from T
where 学生 in (select 学生
from T
group by 学生
having count(*) >1)
order by 成绩 desc
from T
group by 学生
select *
from T
where 学生 in (select 学生
from T
group by 学生
having count(*) >1)
order by 成绩 desc
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
FROM tablename
GROUP BY 学生,成绩
HAVING COUNT(*)>1
SELECT DISTINCT 学生,成绩
FROM tablename
ORDER BY 成绩
2.select * from tablename a where exists(select * from tablename b where a.成绩=b.成绩) order by 成绩
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
Where 学生 in
(select 学生 from table group by 学生
having count(*) > 1)
2.Select * From table
Where 成绩 in (select 成绩 from table group by 成绩 having count(*) > 1)
order by 成绩 desc
2: Select 学生,成绩 from 表 where 成绩 in (Select 成绩 from 表 group by 成绩 having count(*) > 1)
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