oracle - oracle 何时开始支持 PRODUCT 中的 "top": select top ? p2_.PRODUCT_ID?

标签 oracle

oracle什么时候开始支持“top”:

select top ? p2_.PRODUCT_ID from PRODUCT?

最佳答案

我不确定 ORACLE 是否有过 TOP 函数。您想要使用 TOP-N 查询。

例如:

select  *
  from  (SELECT  *
           FROM  foo
          where  foo_id=[number]
       order by  foo_id desc)
 where  rownum <= 3   

这将为您提供前三个结果(因为我在子查询中按 desc 排序)

关于oracle - oracle 何时开始支持 PRODUCT 中的 "top": select top ? p2_.PRODUCT_ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/778355/

相关文章:

oracle - 我可以在 PL/SQL 中返回一个函数吗?

java - 执行大量插入

oracle - 我需要授予访问权限以在另一个模式中使用一个模式的表

oracle - Oracle 10g 如何计算 boolean 表达式中的 NULL

sql - 不清楚 LAST_VALUE - 前面

oracle - 更新 Oracle 包中的单个过程

python - 数据库 API : How to deal with multi where condition in Python

c# - 如何编写参数化的oracle插入查询?

sql - 如何将这个使用临时表的存储过程的输出转换为物化 View ?

oracle - DML 和异常处理 - Oracle