title: Sql where on a computed column count()
body: <p>I am attempting to perform a search of how many times a user has logged into the system.</p>
  <p>There's a table that tracks ip, user and login time.</p>
  <p>I am attempting a simple query like:</p>
  <pre><code>select COUNT(*) as loginCount, ip, email from login_attempts where (loginCount LIKE '%1%') group by `email`
  </code></pre>
  <p>But this leads to an error unknown column 'loginCount', how should this be done then if I want to search a column that was computed in the select?</p>