5 pts.
 top values and ranking
What function do i use to give a field a ranking based on it's current sorted position in a query. I do not want to use a running sum on a report - it needs to be in the underlying query as I am going to have to join several together.

Software/Hardware used:
ASKED: June 24, 2009  11:04 AM
UPDATED: June 24, 2009  2:06 PM

Answer Wiki:
You didn't provide enough information, but the general syntax of the SQL RANK function is the following: <pre>RANK ( ) OVER ( [ < partition_by_clause > ] < order_by_clause > )</pre> Have a look at the following pages for more information and/or examples: <a href="http://msdn.microsoft.com/en-us/library/ms176102.aspx">RANK (Transact-SQL)</a> <a href="http://www.oracle-base.com/articles/misc/RankDenseRankFirstLastAnalyticFunctions.php">Oracle's RANK, DENSE_RANK, FIRST and LAST Analytic Functions</a>
Last Wiki Answer Submitted:  June 24, 2009  2:06 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Please provide me details about application and version.

 0 pts.