select file_id from (
select file_id ,
row_number() over (PARTITION BY prod_nane order by time desc) as row_number
from 表名
where prod_name = #{prodname} and type = ‘02‘
) temp
where temp.row_namber = ‘1‘
取最新的一条记录
2022-02-07 01:02:12
select file_id from (
select file_id ,
row_number() over (PARTITION BY prod_nane order by time desc) as row_number
from 表名
where prod_name = #{prodname} and type = ‘02‘
) temp
where temp.row_namber = ‘1‘
取最新的一条记录