title: Division of two counted values
body: <p>Hi Guys I'm new to SQL I'm trying to divide the output value as explained with the code below</p>
  
  <p>Tried this but it didn't work</p>
  
  <pre><code>SELECT COUNT(DATE_COMPLETE)/COUNT(SUB_SYS) AS FINAL 
  FROM VW_TWCOMPLETION
  </code></pre>
  
  <p>I'm using this code where SUB_SYS has value like A,B,C AND DATE_COMPLETE is a Date value like 11/19/2019 ,12/19/2019 , 13/19/2019 </p>
  
  <pre><code>SELECT  SUB_SYS ,COUNT(SUB_SYS) AS TOTAL , COUNT(DATE_COMPLETE) AS COMPLETE
  FROM VW_TWCOMPLETION
  GROUP BY SUB_SYS
  ORDER BY SUB_SYS
  </code></pre>
  
  <p>I want to Divide the output I get from the count as <code>COMPLETE/TOTAL</code>
  How can I divide these output values?</p>
  
  <pre><code>Table Data
  
  SUB_SYS         
  
  MG1-AS-PWER-05-0
  
  MG1-AS-PWER-06-0
  
  MG1-AS-SPAL-05-0
  
  MG1-AS-SPAL-07-0
  
  TOTAL
  
  6
  
  11
  
  4
  
  17
  
  12
  
  COMPLETE
  
  0
  
  6
  
  0
  
  2
  
  1
  
  0
  </code></pre>
  
  <p>FINAL I AM GETTING WITH BELOW CODE IS</p>
  
  <p>0</p>
  
  <p>0</p>
  
  <p>0</p>
  
  <p>0</p>
  
  <p>0</p>