hi all
i m using oracle8i and my query is that
select dat,decode(v_type,'ct',sum(account)debit,
decode(v_type,'cr',sum(account) credit)
from voucher
group by dat;
this query works fine but if i increase the conditions, i-e
decode(v_type,'ct','ds','gs','ps',sum(account) debit,
this makes some wrong results , my requirement is that if i've these four condtions then all values will be submittedto debit column and rest to credit.
i m using oracle8i and my query is that
select dat,decode(v_type,'ct',sum(account)debit,
decode(v_type,'cr',sum(account) credit)
from voucher
group by dat;
this query works fine but if i increase the conditions, i-e
decode(v_type,'ct','ds','gs','ps',sum(account) debit,
this makes some wrong results , my requirement is that if i've these four condtions then all values will be submittedto debit column and rest to credit.