How do I do top 1 in Oracle?(我如何在 Oracle 中获得前 1 名?)
问题描述
How do I do the following?
select top 1 Fname from MyTbl
In Oracle 11g?
If you want just a first selected row, you can:
select fname from MyTbl where rownum = 1
You can also use analytic functions to order and take the top x:
select max(fname) over (rank() order by some_factor) from MyTbl
这篇关于我如何在 Oracle 中获得前 1 名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!