title: How can I assign row numbers to the table I query in MySQL?
body: <p>It seems so simple, yet I was not able to find any solution that works for me.
  My query looks like this:</p>
  <pre><code>SELECT DISTINCT bedType FROM room;
  </code></pre>
  <p>And the result shows:</p>
  <pre><code>  bedType
    King Bed
    Queen Bed
  </code></pre>
  <p>And I'm trying to assign just numerical value such as:</p>
  <pre><code>  bedType
  1 King Bed
  2 Queen Bed
  </code></pre>
  <p>I tried using <code>row_number()</code> but it didn't work. Is there a simple way of doing this?
  Thank you in advance!</p>
  <p>++</p>
  <pre><code>SELECT DISTINCT bedType, ROW_NUMBER() OVER (ORDER BY bedType) FROM room;
  </code></pre>
  <p>This results in:</p>
  <pre><code>bedType ROW_NUMBER() OVER (ORDER BY bedType)
  King Bed    1
  King Bed    2
  King Bed    3
  King Bed    4
  King Bed    5 
  ... 
  ...
  </code></pre>