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!

subquery Error + backreference?

569151Mar 26 2007 — edited Mar 26 2007
Need Help!

Goal: Create a statement that works like an outer join.

Problem: TABLE1 and TABLE2 cannot be joined because the unique id field "RefDataID" in TABLE2 can refer to the unique id field in other tables depending on the value of "RefTable"

Something like this?

SELECT Data1, DataID (SELECT Data2 FROM TABLE2
WHERE TABLE2.RefDataID=TABLE1.DataID AND TABLE2.RefTable='TABLE1'
LIMIT 1) Data2 FROM TABLE1
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2007
Added on Mar 26 2007
5 comments
121 views