title: Unque numbering rows in SQl Server for duplicate values
body: <p>Is it possible to re-write this query to restart numbering when the UName changes so that my result set is:</p>
  
  <p>1 FerrieC
  2 FerrieC
  3 FerrieC
  1 GrayD
  1 TimneyA
  2 TimneyA</p>
  
  <blockquote>
    <p>SELECT    Row_Number() OVER (ORDER BY
    u.UName) as RowNumber ,   u.UName FROM (
    SELECT    'Ferriec' As UName UNION ALL
    SELECT    'Ferriec' As UName UNION ALL
    SELECT    'Ferriec' As UName UNION ALL
    SELECT    'TimneyA' As UName UNION ALL
    SELECT    'TimneyA' As UName UNION ALL
    SELECT    'GrayD' As UName ) as u</p>
  </blockquote>
  
  <p>Thansk! :)</p>