When the oracle began to support the "top": choose the top? p2_.PRODUCT_ID of PRODUCT?

When the oracle began to support the "top":

select top ? p2_.PRODUCT_ID from PRODUCT?
+5
source share
3 answers

I'm not sure that ORACLE had a TOP function. You want to use the TOP-N query.

For example:

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

This will give you the three best results (because I order descending in the subquery)

+13
source

Oracle does not support the TOP keyword. Request

SELECT TOP 10 product_id
  FROM product

generates a syntax error because the TOP 10 clause is not recognized, at least through Oracle 11.1 (current release).

+4
source

TOP SQL- Oracle. FIRST_ROWS, , .

, Oracle paudocolumn ROWNUM.

+1
source

All Articles