title: increment number generated across Distinct values
body: <p>I have a Table</p>
  
  <pre><code>Apple
  Apple
  Grape
  Grape
  Grape
  Orange
  Orange
  Orange
  </code></pre>
  
  <p>I am looking for an output
  like</p>
  
  <pre><code>1 Apple
  2 Grape
  3 Orange
  </code></pre>
  
  <p>So it should distinct the values and get an auto incrementing number.</p>
  
  <p>My effort so far is like this.</p>
  
  <pre><code>SELECT 
  (row_number() over (order by 'Fruit')) AS 'Id' ,
  'Fruit'
  FROM 
  (
  SELECT 'Fruit'
   FROM myTable  GROUP BY 'Fruit'
   )  t
  </code></pre>
  
  <p>What is the best way to do this over a large dataset.</p>