如何将3.0%变成3%?
SELECT CAST( (CASE 1
WHEN 0
THEN 0
ELSE
CAST( CAST( CAST(CAST(1 AS DECIMAL(10,2)) *100/CAST(40 AS DECIMAL(10,2)) AS NUMERIC(10,0) ) as int) AS CHAR(3))
END)
AS CHAR(3)) + '% ' AS RateHit
1/40 我要显示的是3%
40/40 我要显式的是100%
谁帮我改一下,谢谢了。
------解决方案--------------------select cast(cast(round(cast(1 as float)*100/40,0) as int)as varchar) + '% '