select tab1.* from tab1,(select cola,min(colc) colc from tab1 group by cola) t where tab1.cola=t.cola and tab1.colc=t.colc
select * from tab1 a where not exists(select 1 from tab1 where colA = a.colA and colC < a.colC)
select aa.* from Tab1 aa,(select colA,min(colC) from Tab1 group by colA) bb where aa.colA=bb.colA and aa.colC=bb.colC
蒋老师教导我们: 只要是找最大值或最小值,首先要想到 exists 或 not exists
select b.colA,a.colB,b.colC from tab1 a, (select colA,min(colC) as colC from tab1 group by colA)b where a.colA=b.colA and a.colC=b.colC order by b.colA
from tab1,(select cola,min(colc) colc from tab1 group by cola) t
where tab1.cola=t.cola and tab1.colc=t.colc
where not exists(select 1 from tab1 where colA = a.colA and colC < a.colC)
from Tab1 aa,(select colA,min(colC) from Tab1
group by colA) bb
where aa.colA=bb.colA and aa.colC=bb.colC
(select colA,min(colC) as colC from tab1 group by colA)b
where a.colA=b.colA and a.colC=b.colC
order by b.colA