sqlserver中numeric字段截取

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

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

結果:10.12float

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

結果:10co

 

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

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

結果:10.12

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

結果:10.00

相關文章
相關標籤/搜索