2012-08-13 43 views

回答

1

使用case聲明sum()裏面,像這樣:

select 
    cheque_no, 
    sum(case when transaction_type like `%banking%` then credit else 0 end), 
    date 
from ac_cash_collection 
group by 1,3