oracle 数据库中查询最新的一条记录

时间:2021-08-16 22:50:42   收藏:0   阅读:21

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‘

 

取最新的一条记录

原文:https://www.cnblogs.com/beihaijinyu/p/15149720.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!