How does 'LIMIT' parameter work in sql?

后端 未结 6 1257
余生分开走
余生分开走 2020-12-14 17:52

I have 4000 rows for example, and I define X limit.

The query stops after it finds X rows? or the query finds all the rows and then takes X rows from the found rows?

6条回答
  •  伪装坚强ぢ
    2020-12-14 18:32

    If you are using MS SQL Server, then you can write it as given below.

    Select TOP [x]
    
    *
    From MyTable
    

    Hope it helps.

    Vamyip

提交回复
热议问题