I have a query which is proving to be cumbersome for me. I want to remove the trailing zeroes from the result.
Remove trailing zeros from decimal in SQL Server
Remove trailing zeroes using sql
select concat(100 * round(cast(count(ft.*) filter (where "Realtor_Sale" = 'Yes')
as numeric(12,5)) /
cast(count(ft.*) as numeric(12,5)),3),'%') as "Realtor Sales"
Result I am getting is:
84.800% --------------> I want 84.8%.
I tried doing this as well:
select concat(100 * round(cast(cast(count(ft.*) filter (where "Realtor_Sale" = 'Yes')
as decimal(18,5)) as float) /
cast(cast(count(ft.*) as decimal(18,5)) as float),3), '%') as "Realtor Sales"
Error:
ERROR: function round(double precision, integer) does not exist
select round(cast(cast(count(ft.*) filter (where "Realtor_Sa...
How do I get the result to round of to 84.8%?