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 2005 Forums
 Transact-SQL (2005)
 ROW_NUMBER & RANK functions

Author  Topic 

somu_p
Starting Member

13 Posts

Posted - 2007-06-06 : 03:13:52
Hi,
In SQL Server 2005,we have a functions ROW_NUMBER() and RANK().
I want to know the differences between these two with examples.

Thanks
Somu

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-06 : 03:15:58
Haven't you checked SQL Server help for this?

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

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-06-06 : 09:14:48
or a very simple Google search??

If you want to be a programmer, you must learn how to do basic research and read documentation; asking for help is good, but not when the information is easily found elsewhere.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-06-06 : 09:17:55
make use of the BOL search http://search.live.com/macros/sql_server_user_education/booksonline

row_number() http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=84585
http://msdn2.microsoft.com/en-us/library/ms186734(SQL.90).aspx

rank http://msdn2.microsoft.com/en-us/library/ms176102.aspx

EDIT : Fixed the circular reference bug


KH

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-06-08 : 06:09:27
quote:
Originally posted by khtan

row_number() http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=84585 height="1" noshade id="quote">
Nice
Circular reference is introduced...


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-06-08 : 06:30:47
quote:
Originally posted by Peso

quote:
Originally posted by khtan

row_number() http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=84585 height="1" noshade id="quote">
Nice
Circular reference is introduced...


Peter Larsson
Helsingborg, Sweden


There must be a bug in the C&P


KH

Go to Top of Page
   

- Advertisement -