Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

EXISTS clause

Lalith_JainNov 12 2013 — edited Nov 12 2013

Is it possible to reference a table's column in one exist clause into another in the same query?

for eg.,

SELECT t1.* FROM tableT t1

WHERE EXISTS(SELECT NULL FROM tableT2 t2 WHERE t2.t1id = t1.id)

     AND EXISTS (SELECT NULL FROM tableT3 t3 WHERE t3.id = t2.t2id);

so the point is that t1 has one column in common with t2 whereas t2 has one column in common with t3. I know I can do an inner join on the 3 tables and do it, but is it possible using exists clause?

Please assist.

TIA

This post has been answered by Hoek on Nov 12 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2013
Added on Nov 12 2013
5 comments
422 views