can someone guide me how to turn complicated query like this to honeysql syntax
select sub.*, sub.debits - sub.credits net from
(select sum(case when debit_or_credit = 'debit' then transaction_amount else 0 end) debits,
sum(case when debit_or_credit = 'credit' then transaction_amount else 0 end) credits
from (select * from transactions)
I'm getting stuck at sum(case when
thing