Jonathan Halland wrote:
> If I move the CAMPAIGN_ID=16 to the where clause I will essentially have the
> same as a inner join, I however need to access the records that do not
> necessarily have a matching record in the right side table.

If I understand you correctly, you are trying to get all records from
table "account" which may or may not have a matching record in table
"campaign_handled_objects", right?

>       LEFT JOIN campaign_handled_objects on
> accounts.ACCOUNT_ID=campaign_handled_objects.OBJECT_ID AND
> campaign_handled_objects.CAMPAIGN_ID=16

What you do here is to query all records from table "account" which *do*
have a matching record in table "campaign_handled_objects", namely the
ones that have CAMPAIGN_ID=16. This is in fact an inner join, because
you specified a record field from the right table to be *not null*,
which means that the record must exist. The correct SQL for the above
would read like

        LEFT JOIN campaign_handled_objects on
accounts.ACCOUNT_ID=campaign_handled_objects.OBJECT_ID
WHERE (campaign_handled_objects.CAMPAIGN_ID=16 OR
campaign_handled_objects.CAMPAIGN_ID=16 IS NULL)

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to