Wednesday, June 24, 2015

Oracle money separate pound and cent

to separate pounds from cent in separated column
1- separate pound you need to use trunc
2- separate cent you have to minus rec_amount which mean total amount  from the trunc which represent pound


select REC_AMOUNT,
trunc(rec_amount,0) pound,
rec_amount-trunc(rec_amount,0) cent

from mytable

No comments:

Post a Comment