Thursday, August 23, 2012

SQL Server 2005 New Analytical Functions?


SQL Server 2005 new analytical functions?

1.       Rank:
A)     Display rank for every column value
B)      It manintain gap between ranks
Syntax:
RANK() over (partion By<Columns>
              ORDER by<Columns>)
2.       Dense_Rank:
A)     Takes a rank for every column without gap.
Syntax:
Dense_Rank() over (partition By <Column>
                           Order By <Column>)
3.       Row_Number:
A)     Takes a sequence number for every column.
Syntax:
Row_Number() over (partition By <column>
                              ORDER by <Column>)
4.       NTile:
A)     Distributes the row according to the integer expression specified .
Syntax:
NTile(integer expression) over (partition By <column>
                                               ORDER by <column>)
5.       Pivot:
6.       UNPivot:

No comments:

Post a Comment