|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi all
does any one no how to using sql select * from table where id=x and then wanna select the next 5 rows from the record x |
|
#2
|
||||
|
||||
|
You want to select rows x and then the next five rows?
What is the data type of the id field in your database. What exactly are you trying to do? |
|
#3
|
|||
|
|||
|
Quote:
what i am tryin to do is search a db and when i find a match display what i have foung which will be one record.. i also want to display the next 4 records no matter what they are |
|
#4
|
||||
|
||||
|
Quote:
I'll ask why, even though I'm sure you have a reason for it. |
|
#5
|
||||
|
||||
|
You would have to select the particular record matching the id in one query.
Then you could do this to get the next for. Code:
SELECT TOP 4 * FROM TableName WHERE id > x |
|
#6
|
|||
|
|||
|
Quote:
basically i got a drop down menu system and i am using a piece of javascripot to pass the selected to a search page so it displays the selected item |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Select query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|