Difference between Top and Limit Keyword in SQL

后端 未结 6 1418
你的背包
你的背包 2020-11-27 04:41

A quick Question. Suppose I have the following two queries:

SELECT TOP 2 * FROM Persons;

and

SELECT * FROM Persons limit 2;         


        
6条回答
  •  情歌与酒
    2020-11-27 05:14

    If you are using SQL Server use TOP if you are using MySQL or Postgres use Limit!

    AFAIK there is no product that currently supports both. Here's one list of current implementations and here's another (covers more products but in less detail)

提交回复
热议问题