oracle中sql案例

1.从众多事物中查询每个事物的最新时间的记录。

select c.vin,c.checktime
from (select t.*,
row_number() over(partition by t.vin order by t.checktime desc) rn
from test_table t
where t.vin is not null) c
where rn = 1;

posted @ 2020-01-16 09:54  AWNUygah  阅读(151)  评论(0)    收藏  举报