title: SQL case in select query
body: <p>I have following query</p>
  
  <pre><code>Select
          a,b,c,
          case totalcount
              when 0 then 0
              else abcd/totalcount
          end AS 'd',
          case totalcount
              when 0 then 0
              else defg/totalcount
          end AS 'e'
      From 
          Table1
  </code></pre>
  
  <p>In this query, I have same case statement in select query...Can i make it into single select statement.</p>
  
  <p>"totalcount" is some value... abcd and defg are two column values from table1. If totalcount is zero, i dont want to divide, else I wish to divide to get an average value of abcd and defg.</p>