DECLARE @start INT DECLARE @limit INT DECLARE @page INT ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

DECLARE @start INT
DECLARE @limit INT
DECLARE @page INT

SET @page = 1
SET @start = 1+35*(@page-1)
SET @limit = 35

SELECT * FROM
(
    SELECT row_number() OVER (ORDER BY Reputation DESC) AS i, *
    FROM users
) AS T
WHERE T.i BETWEEN (@start) AND (@start + @limit) 

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached