|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Selecting a specific row
right now, i use "SELECT TOP 1...". If i wanted to get the second, and only second row, what would i have to do? "SELECT TOP 2" selects the top 2, instead of just the second. Help anyone?
|
|
#2
|
|||
|
|||
|
You could do a subselect. Something like this ought to do the trick.
Code:
SELECT TOP 1 FROM ( SELECT TOP 2 col1, col2, col3 FROM table WHERE col4 = 'foo' ) ORDER BY col1 DESC
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Selecting a specific row |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|