select col1,min(col2) from yourtable group by col1
select col1,col2 from (select col1,col2,row_number() over(partion by col1 order by col1,col2) as cn from yourtable ) where cn=1
select col1,col2 from (select col1,col2,row_number() over(partition by col1 order by col1,col2) as cn from yourtable ) where cn=1
查询每组col中,col2最大的那笔select col1,col2 from ( select col1,col2,rownum as rowseq from ( select col1,col2 from table order by col1,col2 ) ) A join ( select col1,max(rownum) as rowmaxcol2 from ( select col1,col2 from table order by col1,col2 ) group by col1 ) B on A.rowseq=B.rowmaxcol2
from yourtable
group by col1
from
(
select col1,col2,rownum as rowseq
from
(
select col1,col2
from table
order by col1,col2
)
) A
join
(
select col1,max(rownum) as rowmaxcol2
from
(
select col1,col2
from table
order by col1,col2
)
group by col1
) B
on A.rowseq=B.rowmaxcol2