Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 RANKING in Sql Query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

chava_sree
Yak Posting Veteran

USA
56 Posts

Posted - 07/24/2008 :  11:51:51  Show Profile  Reply with Quote
Does anybody know how to get Ranking for SQL QUERY for a Resultset.

i need to rank my search Results based on the relevant searches.
(ps: I am not using fullText as it doesn't work for me here).

can anybody pls.suggest a solution for this.

thanks

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 07/24/2008 :  11:53:07  Show Profile  Reply with Quote
have a look at RANK and DENSE_RANK windowing functions in books online
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30421 Posts

Posted - 07/24/2008 :  11:53:26  Show Profile  Visit SwePeso's Homepage  Reply with Quote
There are a number of ranking functions available in SQL Server 2005.

ROW_NUMBER(), RANK(), DENSE_RANK() and NTILE().

Read all about them in Books Online.



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

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 07/24/2008 :  11:54:50  Show Profile  Reply with Quote
http://msmvps.com/blogs/martinpoon/archive/2006/09/22/SQL-Server-2005-ranking-functions-_2D00_-RANK_280029002C00_-DENSE_5F00_RANK_280029002C00_-NTILE_28002900_-.aspx
Go to Top of Page

expert
Starting Member

4 Posts

Posted - 09/17/2011 :  11:36:06  Show Profile  Reply with Quote
This link helps to understand RANK functions with sample examples
http://www.besttechtools.com/SQLArticles.aspx?ID=Rank
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000