您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

测试join using遭遇ORA-25154

2024/3/24 9:46:59发布21次查看
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
如果表名采用别名,,看来也不行。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product