title: Row_Number in Select query with Distinct result
body: <p>I have a query in SQL Server 2012:-</p>
  
  <pre><code>SELECT DISTINCT 
      FIELD_1, FIELD_2
  FROM 
      TABLE_A
  </code></pre>
  
  <p>Now I want to get row number for each record. So I have used <code>ROW_NUMBER()</code> function for this purpose.</p>
  
  <pre><code>SELECT DISTINCT 
      ROW_NUMBER() OVER (ORDER BY FIELD_1, FIELD_2) AS rowId
      FIELD_1, FIELD_2
  FROM 
      TABLE_A
  </code></pre>
  
  <p>This query does not give me distinct result.<br>
  How to retrieve distinct result with row number ?</p>