Oracle SQL:从all_tab_columns中选择不会找到现有列 [英] Oracle SQL: selecting from all_tab_columns does not find existing column
本文介绍了Oracle SQL:从all_tab_columns中选择不会找到现有列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我运行以下查询:
select count(*) from all_tab_columns
where column_name = 'foo'
and table_name = 'VIEW0';
我得到0的结果.我希望是1.
I get 0 for a result. I expect 1.
但是,如果我运行以下查询,则会返回许多(预期)行:
But if I run the following query I get many (expected) rows returned:
select foo from VIEW0;
为什么?我以为我在犯一些愚蠢的语法错误,或者我的理解还差得远.
Why? I'm assuming I'm making some dumb syntax mistake or my understanding is way off.
推荐答案
可能的原因是您具有区分大小写的设置.
Probably the reason is that you have case sensitive setting.
尝试如下添加UPPER
函数.
select count(*) from all_tab_columns
where column_name = upper('foo')
and table_name = 'VIEW0';
这篇关于Oracle SQL:从all_tab_columns中选择不会找到现有列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文