title: mysql multiple count and group values in a same field
body: <p>I was looking around but couldn't find an answer
  I need a query that return 2 groups of values as field names based on values in a same field</p>
  
  <p>example I have a table</p>
  
  <pre>NAME, VALUE
  name1, 2
  name1, 2
  name1, 3
  name1, 4
  name2, 2
  name2, 2
  name2, 3
  name2, 4</pre>
  
  <p>now I want to count and group values 2 and 3 in one group and values 4 in another group so my result would look like this</p>
  
  <pre>NAME, GRP1_COUNT, GRP2_COUNT
  name1, 3, 1
  name2, 3, 1</pre>
  
  <p>I tried the <code>JOIN</code> and <code>UNION</code> without much luck
  any help appreciated</p>