The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement.
I looked for an equivalent of the LIMIT clause for SQL server(2008) and found this one :
SELECT *
FROM (SELECT TOP 30 field1,
field2
FROM (SELECT TOP 10 field1,
field2
FROM matable
ORDER BY mycolumn ASC) AS tbl1
ORDER BY mycolumn DESC) AS tbl2
ORDER BY mycolumn ASC
it displays 30 rows from the 10 row
It works fine!! but when I increase the number from where I want to extract data it takes a lot of time. Does someone have any idea on how to improve this query for SQL server 2008? (my table contains lots of rows and I use this request with PHP and Jquery to display data in the browser)