title: Count query returning unexpected results
body: <p>I have this query:</p>
  
  <pre><code>SELECT
      count(*) as count ,
      ( 3959 * acos(
          cos( radians( 37.774929 ) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians( -122.419418 ) )
          + sin( radians( 37.774929 ) ) * sin( radians( lat ) )
      ) ) AS distance
  FROM users
  HAVING distance &lt; 150
  </code></pre>
  
  <p>I thought it was going to give me the count of users who are in the radius of 150 miles.  But instead it gave me a total number of users.  And if lat/lng were different, it would give me zero number of users when there were some users there.</p>
  
  <p>Any ideas how to change this query in order to get the number of users within the 150mi radius?</p>
  
  <p>Thanks!</p>