Mysql 在SQL中向数字添加百分比
我想在SQL中的数字后面添加一个百分号 这就是我的疑问Mysql 在SQL中向数字添加百分比,mysql,sql,amazon-redshift,Mysql,Sql,Amazon Redshift,我想在SQL中的数字后面添加一个百分号 这就是我的疑问 select cast(vetted as float)/cast(account_create as float)*100 from numbers 我已尝试使用format函数将整数更改为字符串并连接百分号,但这似乎不起作用您可以使用以下解决方案: 您可以尝试以下操作: select CONCAT(cast(vetted as float)/cast(account_create as float)*100,'%') from num
select cast(vetted as float)/cast(account_create as float)*100 from numbers
我已尝试使用format函数将整数更改为字符串并连接百分号,但这似乎不起作用您可以使用以下解决方案:
您可以尝试以下操作:
select CONCAT(cast(vetted as float)/cast(account_create as float)*100,'%') from numbers
您还可以使用函数concat_ws在concat of number和delimeter number之间放置分隔符您使用的是MySQL还是红移?他们完全不同。
select CONCAT(cast(vetted as float)/cast(account_create as float)*100,'%') from numbers