oracle在一张表中,同一个ID 有多条记录,每个ID只获取最新时间的记录 ora分组partition by
程序员文章站
2022-05-17 13:14:00
...
select c.open_id,c.created_date
from (select t.*,
row_number() over(partition by t.open_id order by t.created_date desc) rn
from nec_opr.EC_WECHAT_CALL_DATA_BIND t
where t.open_id is not null) c
where rn = 1;
from (select t.*,
row_number() over(partition by t.open_id order by t.created_date desc) rn
from nec_opr.EC_WECHAT_CALL_DATA_BIND t
where t.open_id is not null) c
where rn = 1;