title: sql Sum calculation
body: <p>I have the below query.. </p>
  
  <pre><code> Select Emp_key,date_key,
   ROUND(SUM(CASE WHEN Amt_2 &lt;&gt; 0 THEN Amt_1/ Amt_2 END),4) AS Net_Amt 
   from Salary
   group by Emp_key,date_key;
  </code></pre>
  
  <p>what result does this query give?</p>
  
  <pre><code>1.Sum[(Amt_1/ Amt_2) + (Amt_1/ Amt_2) + (Amt_1/ Amt_2) + (Amt_1/ Amt_2) + ......]
  </code></pre>
  
  <p>or </p>
  
  <pre><code>2.Sum(Amt_1) / Sum(Amt_2)
  </code></pre>
  
  <p>I want my <code>Net_Amt</code> to be <code>Sum(Amt_1) / Sum(Amt_2)</code></p>