Skip to content
Advertisement

Adding percentage to number in SQL

I would like to add a percentage sign after a number in SQL.

This is the query I have

select cast(vetted as float)/cast(account_create as float)*100 from numbers

I have tried using the format function to change the integer to a string and concatenate the percentage sign, but this doesn’t seem to work

Advertisement

Answer

You can use the following solution using CONCAT:

SELECT CONCAT(CAST(vetted AS FLOAT) / CAST(account_create AS FLOAT) * 100, '%')
FROM numbers
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement