What is the T-SQL equivalent of MySQL syntax LIMIT x, y?

database, sql, sql-server, t-sql

Solution

As i said it less than one hour ago, you have to use TOP ! (LIMIT is used for MYSQL)

So try to remove `LIMIT 5` and do `SELECT TOP(5) apretiz`.

Also, try to add order by (same reason than before).

Please make a search before asking things. Link to old question

Problem

Possible Duplicate: How to write a (MySQL) “LIMIT” in SQL Server? How do I change my query with `LIMIT` for SQL-Server? ``` SELECT apretiz FROM tableApoint WHERE price = '$newprice' LIMIT 5; ``` How do I change `LIMIT 5,10`? Can I use `TOP` for it?

Original source

Related problems