Friday, May 25, 2012

SQL(Simple Query To Generate Auto RowNumbers)


Note: This will generate the auto row number on the runtime according by the data colums define in to “Partition by” method.

SELECT
ROW_NUMBER() OVER (PARTITION BY Left(Column1 , 1),
Column2, Column3 ORDER BY Column4 DESC) AS RowNumber

No comments:

Post a Comment