title: Rails group/having/count query
body: <p>Given a situation like: <code>Company</code> has_many <code>Users</code></p>
  
  <p>To get the Companies that have 3 Users, this works efficiently:</p>
  
  <pre><code>Company.joins(:users).group("companies.id").having("COUNT(users.id)=3")
  </code></pre>
  
  <p>But what's the most efficient way to get the Companies that have 0 Users (none)? Because, obviously, the same approach would not work (as <code>joins</code> by definition excludes Companies with 0 Users):</p>
  
  <pre><code>Company.joins(:users).group("companies.id").having("COUNT(users.id)=0")
  </code></pre>