select ROUND(no_of_order, 2) from #temp
这里 no_of_order 是我的临时表1.2345中45.43215的值。
BUTROUND函数不会对值进行四舍五入。我需要相应的输出为 1.24 和 45.43。相反,现在我得到了相同的 no_of_order 1.2345和45.43215
select ROUND(no_of_order, 2) from #temp
这里 no_of_order 是我的临时表1.2345中45.43215的值。
BUTROUND函数不会对值进行四舍五入。我需要相应的输出为 1.24 和 45.43。相反,现在我得到了相同的 no_of_order 1.2345和45.43215
试试这样: sql fiddle
declare @v nvarchar(50) = '21.89777777777777777777777777'
select convert(decimal(18,2),round(@v,2))