SELECT * from 表名 where a=(select max(a)from 表名) and a=(select max(b)from 表名) and c=a=(select max(c)from 表名)
select a.a, a.b, a.c from (select x.*, row_number() over(partition by x.a order by b desc) rn from tablename x) a where rn = 1
SQL> select * from c1; A B C ---------- ---------- ---------- 1 1 p 1 2 u 1 3 y 2 1 q 2 2 w 2 3 e6 rows selectedSQL> SQL> select a.a, a.b, a.c 2 from (select x.*, row_number() over(partition by x.a order by b desc) rn 3 from c1 x) a 4 where rn = 1 5 ; A B C ---------- ---------- ---------- 1 3 y 2 3 eSQ
from (select x.*, row_number() over(partition by x.a order by b desc) rn
from tablename x) a
where rn = 1
---------- ---------- ----------
1 1 p
1 2 u
1 3 y
2 1 q
2 2 w
2 3 e6 rows selectedSQL>
SQL> select a.a, a.b, a.c
2 from (select x.*, row_number() over(partition by x.a order by b desc) rn
3 from c1 x) a
4 where rn = 1
5 ; A B C
---------- ---------- ----------
1 3 y
2 3 eSQ