Tuesday 3 June 2008

SQL Snippet - Returning Ranked Results with Microsoft SQL Server 2005

TSQL in SQL 2005 provides the following options for ranking your result set.
  • ROW_NUMBER()
  • Ntile(int)
  • Rank
  • Dense_Rank

The above can optionally be used with "Partition By"

see this article. Returning Ranked Results with Microsoft SQL Server 2005 from 4guysfromrolla.

No comments: