i made union to two mysql tables
select cashid, sum(amt) as ramt, NULL AS pamt from receipt where cashid in ('17', '23') GROUP BY cashid union all select cashid, NULL AS ramt, sum(amt) as pamt from payment where cashid in ('17', '23') GROUP BY cashid
and now i want to make calculations between them.
balance = ramt - pamt
can anyone suggest me how can i do that?
thanks in advance