SQL - Select first 10 rows only?

后端 未结 12 641
时光取名叫无心
时光取名叫无心 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 03:54

    Depends on your RDBMS

    MS SQL Server

    SELECT TOP 10 ...
    

    MySQL

    SELECT ... LIMIT 10
    

    Sybase

    SET ROWCOUNT 10
    SELECT ...
    

    Etc.

提交回复
热议问题