如果要查询所有字段则使用下面的sql select * from table where (a,c) in (select a,max(c) from table group by a);
select t.* from tb t where not exists(select 1 from tb where a = t.a and c > t.c) order by t.aselect t.* from tb t where c = (select max(c) from tb where a = t.a) order by t.a
select max(c) from table group by a;
select a, b, max(c) from tb_name group by a, b order by a, b;
select * from( select a,b,c,row_number()over(partition by a order by b desc,c desc) rn from tab ) where rn=1
select t.* from tb t where c = (select max(c) from tb where a = t.a) order by t.a
你是不是想按照A来进行分类再获取其中最大的值?如果是的话语句应该是这样的:SELECT A,MAX(C) FROM 表 GROUP BY A
select * from table where (a,c) in (select a,max(c) from table group by a);
from tb_name
group by a, b
order by a, b;
select a,b,c,row_number()over(partition by a order by b desc,c desc) rn from tab
) where rn=1