Help with multi-join syntax with where clauses

johnmontgomery

New member
Local time
Today, 04:34
Joined
Feb 29, 2016
Messages
5
I have not been able to find a model for multiple joins, both inner and outer left, with where criteria. Here is the From clause that I am getting an error for:
FROM
(( Patron P
INNER JOIN Patron_Address PA1 ON
PA1.patron_id = P.patron_id AND
PA1.address_type = '1')
LEFT OUTER JOIN Patron_Address PA2 ON
PA2.patron_id = P.patron_id AND
PA2.address_type = '2')
LEFT OUTER JOIN Patron_Address PA3 ON
PA3.patron_id = P.patron_id AND
PA3.address_type = '3';

This is not the only place I'm having trouble with inner join syntax, but it is the worst. What am I doing wrong? Thanks.

John
 
this bit (and the others)

AND
PA1.address_type = '1')


needs to be a criteria - joins only relate between tables

as advised in your other thread, use the query builder to see how the code is generated
 

Users who are viewing this thread

Back
Top Bottom