Home » SQL & PL/SQL » SQL & PL/SQL » subquery (oracle 10g)
subquery [message #425717] Mon, 12 October 2009 00:40 Go to next message
ramesh55.sse
Messages: 262
Registered: December 2008
Location: Hyderabad
Senior Member
Can we retrieve data from more than one table using subquery, if it is possible please give me one example.
Re: subquery [message #425722 is a reply to message #425717] Mon, 12 October 2009 00:49 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Yes. Example.

regards,
Delna
Re: subquery [message #425751 is a reply to message #425717] Mon, 12 October 2009 01:57 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Time to REALLY read Database SQL Reference.

Regards
Michel
Re: subquery [message #425769 is a reply to message #425722] Mon, 12 October 2009 02:54 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Quote:
Yes. Example.

regards,
Delna


Except that isn't an example - that's a link to a google query, where none of the top 5 links contain an example of a subquery referencing more than one table.

An Example would be something like:
SELECT *
FROM table_1
WHERE col_1 IN (SELECT t2.col_1
                FROM   table_2 t2
                      ,table_3 t3
                WHERE  t2.col_2 = t3.col_2)

Even better would be an example that included create table and insert statements.
Previous Topic: Rebuilding Index
Next Topic: Striping characters (merged)
Goto Forum:
  


Current Time: Sun Sep 25 23:12:11 CDT 2016

Total time taken to generate the page: 0.11410 seconds