Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
DLTaylor
Posting Yak Master
136 Posts |
Posted - 2006-11-07 : 13:04:20
|
I have received a very strange request where I need to write a select statement that returns the 2nd row in a table.I though this would be easy but cant find a way to return the 2nd row.The basic;Select Top 2*From tablenameReturns rows 1 and 2 but I would like to return only the second row.Note: there is never a set criteria in the 2nd row.any ideas would be much appreciated.Thanks |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-07 : 13:06:24
|
select top 1 * from (select top 2 * from tablename order by somecolumn) q order by somecolumn descPeter LarssonHelsingborg, Sweden |
 |
|
|
|
|