Link to home
Start Free TrialLog in
Avatar of alexhogan
alexhogan

asked on

MSSQL equivalent to MySQLs LIMIT

I am using MSSQL as a backend and I want to put pagination in the pages that display data.

This is the statement that I have so far;

$query = "SELECT * FROM sg_questions LIMIT '$limitvalue', '$limit'";

"LIMIT" seems to be what MSSQL doesn't like.

What is the MSSQL equivalent to MySQLs LIMIT?
ASKER CERTIFIED SOLUTION
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of arbert
arbert

Ya, there really isn't.....Depending on how you're running the query, you can also use

SET ROWCOUNT yourlimivaluehere
SELECT * From sg_questions


Brett