重量除以1000
data/1000
保留三位小数
ROUND(data,3)
转未字符串
CAST(data AS CHAR) AS temp
示例
CAST(ROUND(sWeight/1000,3) AS CHAR) AS sWeight
负数转正数
select ABS(列名)from 表
字符串转数值(保留两位小数)
CAST( 列名 AS DECIMAL (15, 2))
data/1000
ROUND(data,3)
CAST(data AS CHAR) AS temp
CAST(ROUND(sWeight/1000,3) AS CHAR) AS sWeight
select ABS(列名)from 表
CAST( 列名 AS DECIMAL (15, 2))
本文标题:mysql 数值除结果、保留小数、转字符串类型
本文链接:https://www.haomeiwen.com/subject/czdqultx.html
网友评论