sqlserver中numeric字段截取

方法一:convert(float,字段名) as 别名

select convert(float,round(10.123232,2)) 

结果:10.12

select convert(float,round(10,2)) 

结果:10

 

方法二:cast(round(字段名,2) as numeric(20,2)) as 别名

select cast(round(10.123232,2) as numeric(20,2))

结果:10.12

select cast(round(10,2) as numeric(20,2))

结果:10.00

posted @ 2017-06-29 16:04  Jandison  阅读(2105)  评论(0编辑  收藏  举报