title: MySQL select having count
body: <p>I have a table "keywords" which looks like:</p>
  
  <pre><code>keyword_id | domain_id | keyword
      1      |     15    | some_word
      2      |     29    | aaa
      3      |     15    | bbb
  </code></pre>
  
  <p>...and so on. </p>
  
  <p>I want to have a single mysql query which selects all "keyword_id"s if count(domain_id) is more than 100. Put simply, if some domain_id (let's say 15) has more than 100 records in "keywords" table, I want to get all keyword_id records for this domain.</p>
  
  <p>After searching this site for similar questions, I decided to use this one:</p>
  
  <pre><code>SELECT keyword_id FROM `keywords` HAVING COUNT(domain_id) &gt; 100
  </code></pre>
  
  <p>But it doesn't work. This query simply returns absolutely ALL the rows from table.</p>