在数据库查询一个Int类型的平均值时,平均值只返回Int,不保留小数点后数值,转换一下可以得到小数点后值 select AVG(cast column AS decimal(6,1)) as avgColumn from tableName