RE: FN-FORUM: MySQL Query Problems
date posted 31st January 2006 17:26
Just a quick correction to my earlier post, if anyone is following.
The actual query needs an explicit OR... NULL test as follows:
SELECT ABSClients.*
FROM `ABSClients`
LEFT JOIN `ABSdocs_clients`
ON ABSClients.clientID =3D ABSdocs_clients.clientID
WHERE ABSdocs_clients.imageID is NULL
OR ABSdocs_clients.imageID !=3D YOUR SEARCH CONIDION HERE
The explicit NULL test is required because of the SQL typing rules =
regarding
NULL. When LEFT JOIN has no record is to join, it attaches a NULL =
record.
However, a !=3D test will never give a positive match with a NULL =
record,
because of a type mismatch.
Cheers,
James
www.daltonfirth.co.uk