|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
select record limit
how can i select 5 records in 1 page, with button back and foward? example i select first 5 records in first page, and second 5 in second page....
|
|
#2
|
|||
|
|||
|
You can use TOP to get the first 5 results:
SELECT TOP 5 * FROM mytable; I don't know of any way to easily get the next 5 though. What are you using the data in? Can you read in the whole result set and step thru it in increments of 5 with whatever you are using to display the data? |
|
#3
|
|||
|
|||
|
I just thought of something that might work for getting results 6 thru 10. Try something like:
SELECT TOP 10 * FROM tablename WHERE keyfield NOT IN SELECT TOP 5 keyfield from tablename; |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > select record limit |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|