title: MySQL - SELECT AS in WHERE
body: <p>For some reason, this doesn't work:</p>
  
  <pre><code>select substring(rating, instr(rating,',') +1, +2) as val
  from users where val = '15';
  </code></pre>
  
  <p>It gives this error:</p>
  
  <blockquote>
    <p>ERROR 1054 (42S22): Unknown column 'val' in 'where clause'</p>
  </blockquote>
  
  <p>How do I do it then?</p>