limit in mssql
-
mysql has limit to show limited rows but how what does mssql have? i want to make a paging like code i have stumbled on this code select tag, difference from ( select top 4 * from ( select top 8 * from flexi_pump order by tag asc ) as newtbl order by tag desc ) as newtbl2 order by tag asc it works great, but what if the last page only has one row. this sql query shows the last four, not only the last one. (my table has 9 rows)
-
mysql has limit to show limited rows but how what does mssql have? i want to make a paging like code i have stumbled on this code select tag, difference from ( select top 4 * from ( select top 8 * from flexi_pump order by tag asc ) as newtbl order by tag desc ) as newtbl2 order by tag asc it works great, but what if the last page only has one row. this sql query shows the last four, not only the last one. (my table has 9 rows)
Here is an article on Paging results in SQL Server[^]
Upcoming events: * Glasgow: Introduction to AJAX (2nd May), SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website
-
Here is an article on Paging results in SQL Server[^]
Upcoming events: * Glasgow: Introduction to AJAX (2nd May), SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website