This Blog is about MSSQL server 2000/2005 and 2008
Monday, June 11, 2012
Ordering and Ranking a data set
useful technique to pre-order data set
select
DENSE_RANK() over (order by name_first),
RANK() over (order by name_first),
ROW_NUMBER() over (order by name_first),
ROW_NUMBER() over (order by name_last),
*
from users
order by name_first, name_last
No comments:
Post a Comment