title: mysql, order by subquery count
body: <p>I am trying to do this:</p>
  
  <pre><code>SELECT 
      id, user_id, roi, 
      (select count(id) from main_ub U where U.user_id=W.user_id and U.cons &gt; 0) as COUNT 
  FROM 
      main_stats W 
  WHERE 
      week=43 and year=2013 and votes &gt; 2 and COUNT &gt;= 20
  ORDER BY 
      roi desc
  LIMIT 1
  </code></pre>
  
  <p>but I always get this error:</p>
  
  <p><code>#1054 - Unknown column 'COUNT' in 'where clause'</code></p>
  
  <p>Is it possible to use the inner select in my WHERE clause?</p>