首页 > 数据库技术 > 详细

mysql 将指定列的浮点数转化为整数

时间:2016-05-11 19:46:15      阅读:152      评论:0      收藏:0      [点我收藏+]

mysql 将指定列的浮点数转化为整数:

update set B =  cast(B as decimal(10,0)) 
-- 或者
update set B = round(B,0)

 

例如:update hdcloude01.t_a01_eltable set t_a01_eltable.BatteryDal =  round(t_a01_eltable.BatteryDal, 0) where t_a01_eltable.`BatteryDal`  is not null; 

mysql 将指定列的浮点数转化为整数

原文:http://www.cnblogs.com/jym-sunshine/p/5483078.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!