title: SQL COUNT Rows Result in separate columns
body: <p>I currently use this to count all the number or rows in a table and it works well for what i need. </p>
  
  <pre><code>SELECT COUNT(*) AS STCount 
    FROM  (SELECT Distinct DPoint, RNum 
             FROM ECount  
            WHERE DType = 'STR' AND Month(EDate) = '07') AS rows
  </code></pre>
  
  <p>The only issue i have is i have to repeat this statement a lot while just changing a few things each time. I would like to Union these Selects but have the result show in a seperate column, the example below works getting the results but puts them all in the same column. Any ideas how to have them show in their own column one for STCount and NCCount?</p>
  
  <pre><code>SELECT COUNT(*) AS STCount 
    FROM (SELECT Distinct DPoint, RNum 
            FROM ECount  
           WHERE DType = 'STR' AND Month(EDate) = '07') AS rows 
   UNION 
  SELECT COUNT(*) AS NCCount 
    FROM (SELECT Distinct DPoint, RNum 
            FROM ECount  
           WHERE DType = 'NCD' AND Month(EDate) = '07') AS rows
  </code></pre>
  
  <p>result would be,</p>
  
  <pre><code>STCount NCCount
    100     202
  </code></pre>