热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

测试joinusing遭遇ORA-25154

SQLgt;createtableaa(anumber,bnumber);Tablecreated.SQLgt;createtablebb(bnumber,cnumber);Tablecreated.SQLgt

SQLgt; create table aa(a number,b number);Table created.SQLgt; create table bb(b number,c number);Table created.SQLgt

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

如果表名采用别名,,看来也不行。

linux

推荐阅读
author-avatar
mobiledu2502891447
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有