You are here: Re: SQL question - linking and gor « PHP SQL « IT news, forums, messages
Re: SQL question - linking and gor

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`

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация