Oracle JOIN USING子查询:ora-00904字符串:无效的标识符
发布时间:2021-01-18 01:19:01 所属栏目:站长百科 来源:网络整理
导读:我的查询中有一点语法问题(简化): select *from table1 t1inner join table2 t2 using (pk1)inner join table3 t3 using (pk2)where not exists (select1 from table4 t4 where t4.pk1 = t1.pk1) 通过使用“using”关键字,oracle不允许在列名前面使用表标识
我的查询中有一点语法问题(简化): select * from table1 t1 inner join table2 t2 using (pk1) inner join table3 t3 using (pk2) where not exists (select1 from table4 t4 where t4.pk1 = t1.pk1) 通过使用“using”关键字,oracle不允许在列名前面使用表标识符(例如:t1.pk1,只能使用pk1) 如果我写: select * from table1 t1 inner join table2 t2 using (pk1) inner join table3 t3 using (pk2) where not exists (select1 from table4 t4 where t4.pk1 = pk1) 此查询不会给出预期的结果. 但由于我使用的是“存在”子查询,我如何加入此子查询? 当然,我想我可以用另一种方式编写这个查询并避免存在,或者我不能使用“使用”. 但是,是否可以在where子句中将“join / using”与子查询结合使用? 编辑:使用Oracle 10gR2 解决方法有趣的问题!我仍然使用USING时可以管理的最好的是:select * from ( select * from table1 t1 inner join table2 t2 using (pk1) inner join table3 t3 using (pk2) ) v where not exists (select1 from table4 t4 where t4.pk1 = v.pk1) (编辑:青岛站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 荣膺“2019上海创新非凡雇主”,易鑫集团人力资源管理获认可
- 特斯拉打造新语音指令功能 马斯克:最终可用语音指令做任何
- oracle – APEX:apex_application.g_print_error_message问
- 在Oracle SQL Developer中使用Ref Cursor
- 看《冰雪奇缘2》玩同名游戏?腾讯手机管家提醒注意山寨游戏
- 飞刀:让数据实时在线 云原生内存数据库时代到来
- 三甲医院“中招”勒索病毒 网络信息安全不容乐观
- 【重磅】IDC携手迪普科技发布《“三高”应用交付 实现数字化
- 手机语音删除后怎么恢复?语音找回小技巧!
- 投融快讯 | 腾讯入资东方金信数亿元 潮流球鞋APP毒获得DST投
站长推荐