title: T-SQL Count rows with specific values (Multiple in one query)
body: <p>I need some help with a T-SQL query. I want to count fields that have a special value(e.g. >1).</p>
  
  <p>Assuming i have a table like:</p>
  
  <pre><code>IGrp | Item | Value1 | Value2
  #############################
  A    | I11  | 0.52   | 1.18
  A    | I12  | 1.30   | 0.54
  A    | I21  | 0.49   | 2.37
  B    | I22  | 2.16   | 1.12
  B    | I31  | 1.50   | 0.28
  </code></pre>
  
  <p>I want a result like:</p>
  
  <pre><code>IGrp | V1High | V2High 
  ######################
  A    | 1      | 2
  B    | 2      | 1
  </code></pre>
  
  <p>In my mind this should be going with this expression</p>
  
  <pre><code>SELECT IGrp, COUNT(Value1&gt;1) AS V1High, COUNT(Value2&gt;1) AS V2High
  FROM Tbl GROUP BY IGrp
  </code></pre>
  
  <p>But that's not possible in T-SQL since the Count() does not take boolean values.
  So is it really the only possible way to do multiple queries with <code>WHERE Value&gt;1</code> and <code>COUNT(*)</code> and join them afterwards? Or is there a trick to accomplish the desired result?</p>
  
  <p>Thanks in advance.</p>