奇怪的查询行为oracle sql - 将文本转换为数字

时间:2018-01-11 20:54:05

标签: sql oracle

oracle query这是有效的

select *
from (
select to_number(substr(app_cluster,6,2), '99') as  b
from xtern_app_info
WHERE app_cluster IS NOT NULL
AND APP_CLUSTER <> 'CLUSTER'
);

enter image description here

但在添加&#39;其中b&gt; 2&#39;出错了,为什么?

select *
from (
select to_number(substr(app_cluster,6,2), '99') as  b
from xtern_app_info
WHERE app_cluster IS NOT NULL
AND APP_CLUSTER <> 'CLUSTER'
) where b > 2;

ORA-29913:执行ODCIEXTTABLEFETCH标注时出错 ORA-01722:无效的号码 29913. 00000 - &#34;执行%s标注错误&#34; *原因:执行指定的标注导致错误。 *操作:检查错误消息是否采取适当的措施。

0 个答案:

没有答案