select s.* from students s where not exists(select 1 from students where name=s.name and score>s.score)select s.* from students s,(select name,max(score) as score from students group by name) v where s.name=b.name and s.score=v.score
select * /* 多了一个列rk,去掉就列出详细列名 */ from (select rank() over (partition by name order by score ) as rk,t.* from students t) where rk=1;
修正 select * /* 多了一个列rk,去掉就列出详细列名 */ from (select rank() over (partition by name order by score desc) as rk,t.* from students t) where rk=1;
select * from students where (name,score) in (select name,max(score) from students group by name)
select * from students where (name,score) in (select name,max(score) from students group by name)
select a.* from students a, (select name,max(score) score from students group by name) b where a.name=b.name and a.score=b.score;
select a.* from students a, (select name,max(score) score from students group by name) b where a.name=b.name and a.score=b.score;select * from students where (name,score) in (select name,max(score) from students group by name);
(select rank() over (partition by name order by score ) as rk,t.* from students t)
where rk=1;
select * /* 多了一个列rk,去掉就列出详细列名 */ from
(select rank() over (partition by name order by score desc) as rk,t.* from students t)
where rk=1;
where (name,score) in
(select name,max(score)
from students
group by name)
where (name,score) in
(select name,max(score)
from students
group by name)
(select name,max(score) score from students group by name) b
where a.name=b.name and a.score=b.score;
(select name,max(score) score from students group by name) b
where a.name=b.name and a.score=b.score;select * from students
where (name,score) in (select name,max(score) from students group by name);