In some script that works with SQL Server 2008 (although I'm not sure about the version), I get results like 3.000000000000000%, 0.000000000000000%, 4.000000000000000%, etc. and instead, I would like them to be like 3%, 0%, 4%, etc.
I have already tried using CAST as a whole, but this does not work. I think because I want to get "%" as a result.
Does anyone have an idea or can someone tell me that this is simply not possible in SQL Server?
script below
SELECT name, CAST(ROUND(population*100/(SELECT population FROM world WHERE name='Germany'), 0) as varchar(20)) +'%' FROM world WHERE population IN (SELECT population FROM world WHERE continent='Europe');

source share