我需要您的帮助,因为我收到的错误,我使用以下查询才能查看表格中某个百分比列的平均值,但它给出了以下错误消息:
ORA-01722: invalid number 01722. 00000 - "invalid number" *Cause: *Action:
查询:
SELECT 'Skybox' as Platform,avg(PER_OF_VIOLATING_RULES) as
ComplianceCalculation from table_name
PER_OF_VIOLATING_RULES
列中的值:
PER_OF_VIOLATING_RULES
32.08%
55.77%
54.19%
54.84%
16.13%
23.22%
29.50%
5.56%
48.50%
56.04%
PER_OF_VIOLATING_RULES
列是varchar2
数据类型。
答案 0 :(得分:0)
尝试替换%
符号:
SELECT 'Skybox' as Platform,avg(replace(PER_OF_VIOLATING_RULES, '%', '')) as ComplianceCalculation from table_name