title: MSSQL select query with IF () statement
body: <p>I've MYSQL Query, its working fine
  The QUERY Is:</p>
  
  <pre><code>SELECT * , IF(totexec &gt;= totexecrun1, totexec-totexecrun1,0)  AS rewrk, 
        SUM(tcu) tcunit , 
        IF(totexec=0, ((SUM(tcu)/totexec)*100),0) AS proflevel 
  FROM mntest_schedule a 
  LEFT JOIN mnrelease_details b 
     ON b.tester=a.tester 
     AND a.project=b.project 
  LEFT JOIN tc_details c 
     ON b.tc_id=c.tc_name 
     AND a.project=c.project 
  WHERE a.rel_name='automanual_assign' 
  AND a.project='JupiterQA' 
  GROUP BY a.tester;
  </code></pre>
  
  <p>I tried to execute the same Query in MSSQL but its throwing error.
  ERROR IS:</p>
  
  <pre><code>Msg 156, Level 15, State 1, Line 1
  Incorrect syntax near the keyword 'IF'.
  Msg 102, Level 15, State 1, Line 1
  Incorrect syntax near ','.
  Msg 102, Level 15, State 1, Line 1
  Incorrect syntax near ','.
  </code></pre>
  
  <p>Am I did anything wrong with this query?</p>