Home » SQL & PL/SQL » SQL & PL/SQL » sub sub queries
sub sub queries [message #183993] Mon, 24 July 2006 14:37 Go to next message
dhanisetti
Messages: 7
Registered: July 2006
Junior Member
Hello Experts,

how to get data from more than 2 tables using sub sub queries? For example,

select a.column1,b.column1,c.column1,d.column3 from table1 a, table2 b, table3 c,table4 d where a.column2 in (select column1 from tableX where column2 in (select column2 from tableY where column3 in (select column3 from tableZ)))

Please help me on this....


Thanks
Dhani
Re: sub sub queries [message #184027 is a reply to message #183993] Mon, 24 July 2006 23:17 Go to previous message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member



Your Query will produce the CARTESIAN PRODUCT , wihout using the JOIN between table1, table2, table3 & table4 . You can use WHERE EXISTS clause for comparing tableX ,tableY and tableZ as subquery may prove costly from perfomance point of view .

[Search for the bold letters in the Net for more details ]

Thumbs Up
Rajuvan
Previous Topic: NUMERIC VALUES IN WORDS
Next Topic: select statement
Goto Forum:
  


Current Time: Sun Dec 04 20:52:34 CST 2016

Total time taken to generate the page: 0.13016 seconds