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
 Transact-SQL (2000)
 Oracle rownum equivalent in SQL server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-12-30 : 12:10:53
sudheer writes "here i am giving one oracle query, now i want eqivalent query for this.
select * from Accounts where rownum >=5 and rownum <=10;"

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2003-12-30 : 12:21:36
The following articles may help:

http://vyaskn.tripod.com/oracle_sql_server_differences_equivalents.htm
http://www.joesack.com/SQLServerROWNUM.htm
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2003-12-30 : 12:31:47
quote:
Originally posted by AskSQLTeam

sudheer writes "here i am giving one oracle query, now i want eqivalent query for this.
select * from Accounts where rownum >=5 and rownum <=10;"



Just a quick note, you can't have a query in Oracle selecting > rownum. Rownum is a pseudo column attached to the resultset of a query. Because of this, you can only use <, <= or =.

To answer your question, there is no equivalent in SQL Server. However, SELECT TOP can accomplish much of what people use the rownum capability in Oracle for.


-ec
Go to Top of Page
   

- Advertisement -