SQL 语句,类型转换
declare @f float;
declare @i int;
set @f = 123.789;
--set @i = convert(int, @f)
--set @i = cast(@f as int)
--set @i = ROUND(@f, 0, 1);//直接截取
set @i = ROUND(@f, 0); //四舍五入
select @i
加油,努力,奋斗!!
declare @f float;
declare @i int;
set @f = 123.789;
--set @i = convert(int, @f)
--set @i = cast(@f as int)
--set @i = ROUND(@f, 0, 1);//直接截取
set @i = ROUND(@f, 0); //四舍五入
select @i