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!

Need help with an SQL query (joining to lookup table twice)

maleksAug 19 2008 — edited Aug 20 2008
Hi

How would I go about doing this:

I have three tables, lets call them edu, stu and text.

Lets say that the stu table contains the field CLASSNO
The table edu contains the fields CLASSNO and SCHOOLTYPE
The table text contains the fields CODE and CLEARTEXT.

The fields text.CODE and edu.SCHOOLTYPE are related, if for example the field SCHOOLTYPE contains the value 100 I can check what 100 means by looking at the table TEXT using something like:

select text.CLEARTEXT from edu, text WHERE text.CODE = edu.SCHOOLTYPE

How would I go about getting the data from the text.CLEARTEXT field when I mix in the stu table as I need to make sure I get the text.CLEARTEXT where the value of stu.CLASSNO and edu.CLASSNO are the same.

Thanks

Message was edited by:
alekz
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2008
Added on Aug 19 2008
7 comments
372 views