Connor and Chris will both be at AI World from October 12 to October 17 , the premier Oracle conference of 2025. If you're in Vegas, please come say Hi or pop into our sessions
Thanks for the question, Nikhil.
Asked: September 14, 2016 - 12:31 pm UTC
Last updated: September 15, 2016 - 10:07 pm UTC
Version: 12.1.0.2.0
Viewed 10K+ times! This question is
SQL> conn chris/chris@12c Connected. SQL> select * from v$version; BANNER CON_ID -------------------------------------------------------------------------------- ---------- Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0 PL/SQL Release 12.1.0.2.0 - Production 0 CORE 12.1.0.2.0 Production 0 TNS for Linux: Version 12.1.0.2.0 - Production 0 NLSRTL Version 12.1.0.2.0 - Production 0 Elapsed: 00:00:00.55 SQL> with rws as ( 2 select rownum x, 'X' dummy from dual 3 ) 4 select * from rws r 5 where exists ( 6 select null from dual d, ( 7 select x, dummy from rws s where r.x = s.x 8 ) s 9 where d.dummy = s.dummy 10 and s.x = r.x 11 ); X D ---------- - 1 X SQL> conn chris/chris@11g Connected. SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production PL/SQL Release 11.2.0.4.0 - Production CORE 11.2.0.4.0 Production TNS for Linux: Version 11.2.0.4.0 - Production NLSRTL Version 11.2.0.4.0 - Production Elapsed: 00:00:00.54 SQL> with rws as ( 2 select rownum x, 'X' dummy from dual 3 ) 4 select * from rws r 5 where exists ( 6 select null from dual d, ( 7 select x, dummy from rws s where r.x = s.x 8 ) s 9 where d.dummy = s.dummy 10 and s.x = r.x 11 ); select x, dummy from rws s where r.x = s.x * ERROR at line 7: ORA-00904: "R"."X": invalid identifier SQL> SQL> with rws as ( 2 select rownum x, 'X' dummy from dual 3 ) 4 select * from rws r 5 where exists ( 6 select null from dual d, ( 7 select x, dummy from rws s 8 ) s 9 where d.dummy = s.dummy 10 and s.x = r.x 11 ); X D ---------- - 1 X SQL>
A reader, September 14, 2016 - 4:38 pm UTC
Albert Nelson A, September 15, 2016 - 8:08 am UTC
Albert Nelson A, September 16, 2016 - 9:47 am UTC
Share and learn SQL and PL/SQL; free access to the latest version of Oracle Database!
Classes, workouts and quizzes on Oracle Database technologies. Expertise through exercise!