title: postgresql condition to only apply on one column in the select
body: <p>I have a query as follows </p>
  
  <pre><code>select
      cheque_no,
      sum(credit),
      date
  from ac_cash_collection
  group by 1,3;
  </code></pre>
  
  <p>now I want <code>sum(credit)</code> from records whose <code>transaction_type ilike banking</code>, but this condition should not apply on other columns.</p>