Posted by cluthz on 05/15/07 15:16
"Captain Paralytic" <paul_lautman@yahoo.com> wrote in message >
> You are right, that paragraph is complete nonsense and I cannot figure
> out what you are trying to say.
(embarassement smiley).
Despite that your answer does answer my question and makes good clear sense.
Thanks for your input!
> To find rows that have no matching row, the safest thing is to check
> the primary key for NULL. That avoids the possibility that the row
> exists but the particular field happens to be NULL.
>
> So I would use:
> AND email_foriegnkey IS NULL
> This is assumig that email_foriegnkey is the field in the table
> emailaddresses.
> I always qualify my fields, so that it is obvious where they exist.
> Thus:
> SELECT
> *
> FROM `accounts` `a`
> LEFT JOIN `emailaddresses` `e` on (`a`a.`account_key` =
> `e`.`email_foriegnkey`)
> WHERE (my other dynamically built search criteria on account)
> AND `e`.`email_foriegnkey` IS NULL
> GROUP BY `a`.`account_key`
[Back to original message]
|