将数字结果转换为带有十进制数字的百分比 [英] Convert numeric result to percentage with decimal digits

查看:130
本文介绍了将数字结果转换为带有十进制数字的百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此查询:

Select count(incidentnumber) as average
from incidents
Where IncidentStationGround <> firstpumparriving_deployedfromstation;

我得到了一个结果,大约是20,000。但是如何将这个数字转换为百分比?另外,我希望结果以十进制表示,可以吗?

I got a result, it's something like 20,000. But how can I convert this number to a percentage? Plus, I want the results in decimal, can I?

推荐答案

您在注释中的查询应该可以将
转换为十进制以达到十进制百分比

your query in comment should work cast count to decimal to achieve decimal percentage

count(incidentnumber)::decimal*100

这篇关于将数字结果转换为带有十进制数字的百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆