Oracle-不能在选择子句中的其他列上使用*符号 [英] Oracle - Can't use * sign with other column in select clause
问题描述
很抱歉,这很琐碎,但是选择带有*
符号的列并不总是有效,而且我没有找到对此行为的引用.
Sorry if it's trivial, but selecting column with *
sign isn't working always, and I don't find reference to this behavior.
我可以使用以下语句选择表A
和列col
:
I can select table A
and column col
with the following statements:
select * from A;
和select col from A;
和select aa.col,aa.* from A aa;
但是我无法一起查看:
select *,col from A;
将导致错误ORA-00923: FROM keyword not found
select col,* from A aa;
将导致错误ORA-00936: missing expression
为什么我必须对*
符号使用别名?
Why i must use the alias for *
sign ?
select col,aa.* from A aa;
为什么错误如此令人误解?
Why are the errors so misleading?
推荐答案
The restriction is not so clearly stated in documentation, but you can find it by following this diagram.
在这里您看到,如果使用*
,则选择列表中将无法使用其他任何内容
Here you see that if you use the *
, you can't use anything else in select list
这篇关于Oracle-不能在选择子句中的其他列上使用*符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!