Oracle取查询结果第一条记录SQL
select * from ( select e.id,e.filename,e.status,e.version,e.url,e.file_type, (select max(e.version) from eig_upload e where e.file_type = 1 and e.game_id = '4028822f46d66cf70146d66fe69e0002') as times from eig_upload e where e.file_type = 1 and e.game_id = '4028822f46d66cf70146d66fe69e0002' and e.status = 1 order by e.update_time DESC ) where rownum = 1
本文介绍了一种在Oracle数据库中使用SQL查询特定条件下的最新版本文件的方法。通过子查询获取最大版本号,并结合主查询返回对应记录。适用于游戏等需要版本管理的应用场景。
1296

被折叠的 条评论
为什么被折叠?



