select * from (SELECT
r.*
FROM
( SELECT r.* , row_number () over ( partition BY r.std_bk_measure_id ORDER BY r.this_time DESC ) px FROM WI_MEASURE_RCD_R r where r.FLAG_VALID = ‘1’ ) r
WHERE r.px = 1
ORDER BY
r.this_time DESC)
select to_char(r.this_time, ‘yyyy’) yy, to_char(r.this_time, ‘mm’) mm, r.* from (
select r.* , row_number() over (partition by r.std_bk_measure_id order by r.this_time desc) px
from WI_MEASURE_RCD_R r where r.FLAG_VALID = ‘1’)r
where r.px = 1
order by r.this_time desc
【无标题】oracle 查询最新一条数据
最新推荐文章于 2024-07-16 15:12:44 发布