Home >> FAQs/Tutorials >> SQL Server FAQ
SQL Server FAQ - Returning the Second 5 Rows from a Query
(Continued from previous topic...)
How To Return the Second 5 Rows?
If you want to display query output in multiple pages with 5 rows per page,
and the visitor wants to see the output for the second page, you need to display
query output from row 6 to row 10.
If you are using MySQL server, you can use the "LIMIT startRow maxRows".
But the LIMIT clause is not supported by the SQL server.
And there seems to be no easy workaround.
You may consider to return the top 10 rows, skip the first 5 rows,
then keep the second 5 rows.
(Continued on next topic...)
- How To Join Two Tables in a Single Query?
- How To Write a Query with an Inner Join?
- How To Define and Use Table Alias Names?
- How To Write a Query with a Left Outer Join?
- How To Write a Query with a Right Outer Join?
- How To Write a Query with a Full Outer Join?
- How To Write an Inner Join with the WHERE Clause?
- How To Name Query Output Columns?
- What Is a Subquery in a SELECT Query Statement?
- How To Use Subqueries with the IN Operators?
- How To Use Subqueries with the EXISTS Operators?
- How To Use Subqueries in the FROM Clause?
- How To Count Groups Returned with the GROUP BY Clause?
- How To Return the Top 5 Rows from a SELECT Query?
- How To Return the Second 5 Rows?
- How To Use UNION to Merge Outputs from Two Queries Together?
- How To Use ORDER BY with UNION Operators