|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to write a query that will return rows between two specified numbers.
Top does not return results between x and y. I searched in a lot of places without any luck. Is there not a sql statement to simply return rows between x and y. example: Select distinct <syntax i dont know> top 50, 100 </syntax i dont know> company, employee from company; Thanks. |
|
#2
|
|||
|
|||
|
should you use a Where clause for this?
or are you trying to get all the rows between row 50 and row 100? but why, I don't understand...are you trying to do paging manually? try to explain what you result should look like, I might be able to help you then |
|
#3
|
|||
|
|||
|
Quote:
Yes, I am trying to do paging. I would like the users to see records in limits of 15 or 25, with next and previous buttons. |
|
#4
|
|||
|
|||
|
well...depends on your system...I know ASP.net does it...but not SQL directly...but your can do it manually with a primarey ...it's tricking but you can do it...
|
|
#5
|
||||
|
||||
|
See this tutorial
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > get rows between x and y |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|