title: row number and distinct together
body: <p>Given table "table1"</p>
  
  <pre><code>name
  ------
  Jhon
  Jhon
  Robert
  Robert
  Robert
  </code></pre>
  
  <p>Needed get unique names and also numeric names as queue,
  that is result bust be:</p>
  
  <pre><code>1  Jhon
  2  Robert
  </code></pre>
  
  <p>this query not works</p>
  
  <pre><code>SET @n = 0;
  
  SELECT @n := @n + 1 AS n,  DISTINCT  name FROM table1
  </code></pre>
  
  <p>I dont ask how to make this, (this may be make with sub-querys right?) , my question is: why dont working query, which I writed upstairs? why dont like mysql this query?</p>