select LATEFEE,REALACCOUNT from VIEW_HOUSE_CHARGE.其中LATEFEE,REALACCOUNT 这两个字段都为varchar 现在要做的是 select LATEFEE+REALACCOUNT as REALACCOUNT from VIEW_HOUSE_CHARGE.如何转化 能正确执行 这个语句 (LATEFEE+REALACCOUNT这里不会)抱歉 是我没有写详细,LATEFEE,REALACCOUNT 这两个字段都是varchar类型 我想做 它两之间的运算 然后把值给REALACCOUNT 整个过程在执行那个SQL语句时完成 最后返回的是REALACCOUNT 并且内容是LATEFEE,REALACCOUNT 相加的结果!
字符串拼接:select LATEFEE||'-'||REALACCOUNT from VIEW_HOUSE_CHARGE--字符串拼接,在oracle中 ||'?'|| 其中?可为任意字符串数字转换:①去余select trunc((to_number(LATEFEE)+to_number(REALACCOUNT)),2) REALACCOUNT from VIEW_HOUSE_CHARGE②四舍五入select round((to_number(LATEFEE)+to_number(REALACCOUNT)),2) REALACCOUNT from VIEW_HOUSE_CHARGE