How do I limit the number of rows returned by an Oracle query after ordering?

前端 未结 17 1554
夕颜
夕颜 2020-11-21 04:56

Is there a way to make an Oracle query behave like it contains a MySQL limit clause?

In MySQL, I can do this:

         


        
17条回答
  •  醉梦人生
    2020-11-21 05:05

    On Oracle 12c (see row limiting clause in SQL reference):

    SELECT * 
    FROM sometable
    ORDER BY name
    OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY;
    

提交回复
热议问题