subquery Error + backreference?
569151Mar 26 2007 — edited Mar 26 2007Need 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