select (select m3.bal
from tlm_gt_custom m3
where m3.acc = m1.acc
and m3.ccy = m1.ccy
and trunc(m3.val_dt) >= trunc(add_months(sysdate, -1), 'MM')
and rownum = 1) begining_of_month
from tlm_gt_custom m1 where m1.ccy = 'USD'
and m1.acc = '9820084080783001'
group by m1.ccy, m1.acc
How to display 0 if there is no data in the above query