SQL - Select first 10 rows only?

后端 未结 12 658
时光取名叫无心
时光取名叫无心 2020-11-28 03:24

How do I select only the first 10 results of a query?

I would like to display only the first 10 results from the following query:

SELECT a.names,
            


        
12条回答
  •  没有蜡笔的小新
    2020-11-28 04:08

    Oracle

    WHERE ROWNUM <= 10  and whatever_else ;
    

    ROWNUM is a magic variable which contains each row's sequence number 1..n.

提交回复
热议问题