title: row number always return 1 for each row in sql server
body: <pre><code>(SELECT 
      (SELECT ROW_NUMBER() OVER (order by t.NotificationID)) as  RowNumber,
              [NotificationID],[ProjectID],[TeamMemberID],[OperationType],
              [Hours],[Occurance],[Period],[NotificationText],
              [NotificationRecipientIDs],[NotificationRecipientClienitsIDs]
  
         FROM tblIA_Notifications t
         WHERE IsDeleted = 0 AND IsActive = 1
      ) 
  </code></pre>
  
  <p>The above query always returns rownumber 1 for each row. When I use the select statement outside, its problem. Otherwise if I remove the outer select statement its fine.</p>
  
  <p>I don't understand the behavior.</p>