程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> 測試joinusing遭遇ORA-25154

測試joinusing遭遇ORA-25154

編輯:Oracle教程

SQL> create table aa(a number,b number);

Table created.

SQL> create table bb(b number,c number);

Table created.

SQL> insert into aa values(1,2);

1 row created.

SQL> insert into aa values(2,3);

1 row created.

SQL> insert into bb values(2,4);

1 row created.

SQL> insert into bb values(5,6);

1 row created.

SQL> commit;

Commit complete.

SQL> select aa.a,aa.b,bb.c from
2 aa join bb using(b);
select aa.a,aa.b,bb.c from
*
ERROR at line 1:
ORA-25154: column part of USING clause cannot have qualifier

SQL> !oerr ora 25154
25154, 00000, "column part of USING clause cannot have qualifier"
// *Cause: Columns that are used for a named-join (either a NATURAL join
// or a join with a USING clause) cannot have an explicit qualifier.
// *Action: Remove the qualifier.

SQL> select aa.a,b,bb.c from
2 aa join bb using(b);

A B C
---------- ---------- ----------

1 2 4

看來連接條件出現在查詢中,不能帶表名,測試別名是否可行。


SQL> select x.a,x.b,y.c from
2 aa x join bb y using(b);
select x.a,x.b,y.c from
*
ERROR at line 1:
ORA-25154: column part of USING clause cannot have qualifier

如果表名采用別名,看來也不行。



  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved