title: If operator in groovy sql select statement
body: <p>I would like to use the if operator in the select statement, using an executeQuery command.
  Something like:</p>
  
  <pre><code>def tmpRec = BankStatement.executeQuery("select   SUM(IF(operation='CREDIT',cashAmount,-1*cashAmount)) from BankStatement group by portfolio,currency,code")
  </code></pre>
  
  <p>go
  but the IF operator doesn't work. </p>
  
  <p>thank you</p>