The SQL Server equivalent for the MySQL Limit


In MySQL, you can use “Limit n,m”, like this:

select *
from sometable
order by name
limit 20,10

And in SQL Server, use this query:

      SELECT *,
        ROW_NUMBER() OVER (ORDER BY name) as rowNum
      FROM sometable
) sub
WHERE rowNum > 20
  AND rowNum <= 30

In Oracle: .

In DB2: .

In Mysql: .

In Sqite: .

In PostgreSQL: .

You can visit this page for more information: .

Some SQL Server tools you can try: