求教To_number转化问题
瞌觉兴国 2015-08-27 01:38:47 原句
select x.exp_report_header_id 头ID,
x.exp_report_line_id 行ID,
x.report_amount 总金额,
y.expense_object_desc 税码,
to_number(h.description,'9999') 总金额X税码
from exp_report_lines x,
exp_report_objects y,
EXP_REPORT_OBJECTS z,
exp_expense_object_types_vl h
where x.exp_report_line_id = y.exp_report_line_id
and x.exp_report_line_id = z.exp_report_line_id
and h.expense_object_type_id = z.expense_object_type_id
and h.expense_object_type_code = 'TAX_CODE'
and x.exp_report_header_id = 179840
句子的意思是查出税额是多少(即总金额×税码) 税码是 varchar类型的 值为 6%
我想把它转化成 number类型好做运算。但是 TO_NUMBER 怎么写都不对,一直报无效数字。 求教这里该怎么写