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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How could I return the next row(Or 8th row for exa

Author  Topic 

Ach
Starting Member

13 Posts

Posted - 2005-09-25 : 09:03:13
Hi,
I want to return the next row in a select ... order by ... cursor.
I don't want to loop,just SQL,Do you know any solution?
For example: in Oracle we use rownum,is there any equivalent in SQL Server?
-Thanks

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-26 : 00:49:25
If you want to get eight row by ascending order of the keycolumn then

Select Top 1 columns from
(
Select top 8 columns from yourTable order by KeyCol Asc
)T
order by keycol Desc


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -