title: How to sum up only specific values in group by
body: <p>I have the following data</p>
  
  <pre><code>Name Place Stores Sales
  A X1 10 $100
  A X2 20 $150
  B X2 25 $200
  B X3 30 $300
  B X4 40 $400
  C X1 30 $300
  D X2 40 $400
  D X3 50 $500
  </code></pre>
  
  <p>I want to get the Group By Statement to give Name wise Sum of Stores, Sales and Count of Observations (for that Name) only if Stores in that observation are > 20.</p>
  
  <p>So in this example A will not be there in the result at all. Sum of B will be there only with stores 25 and 30 and so on.</p>
  
  <p>How to write SQL query for this.</p>