Igor Tandetnik wrote:
Stef Mientki <[EMAIL PROTECTED]> wrote:
I use the following syntax, and I get 7 records back,
(which is not correct in my opinion)

SELECT PO.* FROM Koppel
 LEFT JOIN PO
   WHERE (Koppel.K_App == PO.App)
         AND (Koppel.K_naam == 'MVE')
         AND (PO.ALL_answered == '0')

If I leave the last line out,
I get 16 records (which might be ok, I can't check it)

Left join would produce records with all NULLs in the PO half where no record in PO matches that in Koppel.
Thanks Igor,
I think you hit the nail on it's head.
Because the tables were quit large,
I imported some of tables just partially.
I'll check tomorrow.
The test of (PO.ALL_answered == '0') then filters out those records where PO.ALL_answered is NULL. Make it

SELECT PO.* FROM Koppel
 LEFT JOIN PO
   ON (Koppel.K_App == PO.App)
         AND (Koppel.K_naam == 'MVE')
         AND (PO.ALL_answered == '0')

Now if I only invert the last line,
and suposing the above results where ok (which isn't),
I should get 16-7= 9 records back.

When PO.ALL_answered is NULL, both (PO.ALL_answered == '0') and (PO.ALL_answered != '0') are false.

But this just returns 0 records ????

Apparently, in all rows PO.ALL_answered is either '0' or NULL.
That's indeed the case , all '0' ;-)

cheers,
Stef Mientki


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to