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)
 what's equivalent to rank() in sql 2000?

Author  Topic 

ayu
Starting Member

43 Posts

Posted - 2008-04-08 : 12:39:51
i m using sql 2000
my query:
SELECT no, name, desc,createddate
FROM (
SELECT no, name, desc,createddate,
RANK() OVER (PARTITION BY name) AS RecID
FROM compilationt ) AS a
WHERE RecID = 1

it gives me error:
'RANK' is not a recognized function name.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-08 : 12:43:29
RANK() is supported only in SQL Server 2005 and higher version.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-08 : 12:46:24
You have two choices.

1) Use a correlated subquery.
2) Use a temp table with an IDENTITY column.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-08 : 12:50:16
one of methods:-

http://www.codeproject.com/KB/reporting-services/Rank_Query.aspx
Go to Top of Page

ayu
Starting Member

43 Posts

Posted - 2008-04-08 : 14:04:32
thanks visakh,

this article helps a lot!!

Go to Top of Page
   

- Advertisement -