Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to assign Unique Number for the result

$
0
0

Hi

How can I get Continuous Ranking Number  ( or Unique Number for the result set. )for the below Image.

Please kindly excuse me for my bad explanation.

 SELECT
  
 NTILE (1000) OVER(PARTITION BY M,Pre_PostRenewalindicator ORDER BY M   ) Ranking,M,Pre_PostRenewalindicator
   
FROM    [COM_Util].[dbo].[Milliman_Max]
WHERE M IN (11, 12 )
ORDER BY  [GroupNumber]


Viewing all articles
Browse latest Browse all 23857

Trending Articles