15.55这个数字
replace替换数据后乘以100,在Navicat中运行,是显示整数
但是在Python中调用SQL语句,使用replace替换数据并乘以100后,会显示有一位小数,并且使用round等方法无法取整
最终采用cast函数将replace后的数字转成整数
CAST(value as type)
CAST(value as SIGNED),将数据转成整数,SIGNED代表整数
select CAST(REPLACE(uld.to_am,'-','')*100 AS SIGNED) from transfer_arrears as ta LEFT JOIN( select apply_sn,user_id,sum(amount) as to_am from user_loan_detail WHERE type=4 GROUP BY user_id) as uld on ta.sn=uld.apply_sn WHERE ta.work_flow_status=4 and uld.to_am <> ''
在Python中运行后,数据显示1555,没有小数点,成功取整