Collections:
Returning the Second 5 Rows from a Query in SQL Server
How To Return the Second 5 Rows in SQL Server?
✍: FYIcenter.com
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.
⇒ UNION - Merging Outputs from Two Queries Together in SQL Server
⇐ "TOP" - Return the Top 5 Rows from a SELECT Query in SQL Server
⇑ Using SELECT Statements with Joins and Subqueries in SQL Server
2016-10-29, 1534🔥, 0💬
Popular Posts:
What are binary literals supported in SQL Server Transact-SQL? Binary literals in Transact-SQL are s...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
What Happens If the UPDATE Subquery Returns Multiple Rows in SQL Server? If a subquery is used in a ...
How Fixed Length Strings Are Truncated and Padded in SQL Server Transact-SQL? When the length of the...