title: query impossible for me?
body: <p>I have 2 columns <code>a</code> and <code>b</code> with a 1:n relation:</p>
  
  <pre><code>A.id, a.text, a.b_id(fk), a.value --
  B.id(pk), b.text etc
  </code></pre>
  
  <p>I want to create a query that returns the number of <code>b.id</code> with <code>count(a.value=1) &gt; 0</code></p>
  
  <p>I tried this:</p>
  
  <pre><code>Select count(b.id)
  from a.id
  join b on a.b_id=b_id
  group by b.id
  having count(if(a.value=1),1,null))&gt;0
  </code></pre>
  
  <p>...but without result. It seems simple but for me is a problem.</p>