Oracle去除重复(某一列的值重复),取最新(日期字段最新)的一条数据

https://blog.csdn.net/w405722907/article/details/78561995

order by 字段需注意,null排第一位

select * from (

  select t.*, row_number() over(partition by t.ywh ORDER BY t.ywh) as bj  from table t

  ) res where res.bj = 1

原文地址:https://www.cnblogs.com/shihx/p/12035855.html