SELECT natural_account
|| ' '
|| subaccount account,
TRIM(TO_CHAR(ROUND(NVL(BEGIN_BALANCE,0), :G_PRECISION),'9999999999999999999990.00')) begin_balance,
TRIM(TO_CHAR(ROUND(NVL(PERIOD_NET_DR,0), :G_PRECISION),'9999999999999999999990.00')) period_net_dr,
TRIM(TO_CHAR(ROUND(NVL(PERIOD_NET_CR,0), :G_PRECISION),'9999999999999999999990.00')) period_net_cr,
TRIM(TO_CHAR(ROUND(NVL(END_BALANCE,0), :G_PRECISION),'9999999999999999999990.00')) end_balance
FROM (Select *
From jl_mx_gl_accounts_t
Order By natural_account, subaccount) jl_mx_gl_accounts_t
WHERE Sat_account IS NOT NULL
AND ( NVL(BEGIN_BALANCE,0) <> 0
Or NVL(PERIOD_NET_DR,0) <> 0
Or NVL(PERIOD_NET_CR,0) <> 0
Or NVL(END_BALANCE,0) <> 0)
CONNECT BY parent_account = Prior natural_account
START WITH parent_account IS NULL |