select *
from (select kk.nm_info_id,
kk.st_info_title,
tt.nm_attach_id,
attach.st_attach_title
from pb_information kk
left join (select distinct (FIRST_VALUE(t.nm_info_attach_id)
OVER(PARTITION BY i.nm_info_id ORDER BY
t.dt_input desc)) as nm_attach_id,
i.nm_info_id
from pb_info_attach t
left join pb_information i on i.nm_info_id = t.nm_info_id
where t.st_attach_type = '.jpg'
and i.st_is_handin = '3'
and i.st_del_flag = '0') tt on kk.nm_info_id = tt.nm_info_id
inner join pb_info_attach attach on attach.nm_info_attach_id = tt.nm_attach_id
order by kk.dt_deploy_date desc)
where rownum <= 8
FIRST_VALUE
最新推荐文章于 2022-09-09 10:44:51 发布