rdhatch
MIS
- Jan 30, 2008
- 3
Problem: Cannot LEFT JOIN on x AND y when x and y are in different tables. "Join expression not supported" error.
PROVEN SOLUTION: If you want a true left join - where records are optional - and you're filtering by multiple fields in different tables - Then I have your answer.
To do filtering on fields from other tables - we need to use the WHERE clause. The key here is: You need to make the WHERE clause matches whether or not there are records in table you are LEFT JOINing. This is your answer:
WHERE (LEFTJOINTABLE.id IS NULL) OR (LEFTJOINTABLEid IS NOT NULL AND (__PUT YOUR JOIN FILTERS HERE__) )
Hope this helps you!
Ryan
THIS FIX REFERENCES:
PROVEN SOLUTION: If you want a true left join - where records are optional - and you're filtering by multiple fields in different tables - Then I have your answer.
To do filtering on fields from other tables - we need to use the WHERE clause. The key here is: You need to make the WHERE clause matches whether or not there are records in table you are LEFT JOINing. This is your answer:
WHERE (LEFTJOINTABLE.id IS NULL) OR (LEFTJOINTABLEid IS NOT NULL AND (__PUT YOUR JOIN FILTERS HERE__) )
Hope this helps you!
Ryan
THIS FIX REFERENCES: