SELECT * FROM (SELECT ROW_NUMBER() OVER(PARTITION BY t.c_planid ORDER BY t.c_enddate desc) rn, t.* FROM tb_wd_orgplaninflowphase t where t.c_enddate<sysdate) WHERE rn = 1 ;
orcal 查询离当前时间最近的数据
最新推荐文章于 2024-06-13 14:07:11 发布