SQL Server Forums
Profile | Register | 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
 New Topic  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
52309 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
30106 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
52309 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  
 New 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.06 seconds. Powered By: Snitz Forums 2000