爱玺玺

爱玺玺的生活日记本。wx:lb87626

sqlserver2005的float和numeric类型比较

use BBB;

go 


drop table sname;

go

create table sname(

salary numeric(10,2),

height float(2)

);

go

insert into sname values(100.2266,100.2266);

go

select * from sname;


输出结果:

numeric会做四舍五入保留二位小数,float会保留全部小数


一般建议使用numeric的人比较多。



发表评论:

Powered By Z-BlogPHP 1.4 Deeplue Build 150101

Copyright Your WebSite.Some Rights Reserved.

蜀ICP备11021721号-5