Oracle分組後對分組內容重複 的以另一列排序後 取第一個
語句
select * from(
select a.grep, row_number() over (partition by a.grep order by a.create_time desc nulls last) row_num
from test a
) aa where aa.row_num = 1 --獲取分組排序後的第一個
row_number() over(partition by A order by B )
A爲分組字段
B爲分組後排序的字段