Reply to Re: need help writing a SQL statement

Your name:

Reply:


Posted by Oli Filth on 10/13/55 11:28

jj wrote:
> thanks for the quick reply it works great, im trying to learn here, can you
> explain why my statement wouldnt work? i have used such statements with the
> AND operator with success before im just curious why the OR doesnt give the
> right output.
>
> select customers_email_address, email from newsletter,customers where
> customers_email_address='t...@test.com' OR email='t...@test.com';

A FROM clause of the form "FROM t1, t2" is syntatically equivalent to
"FROM t1 INNER JOIN t2". An inner join causes the tables to be
multiplied, i.e. the result set is every possible combination of
newsletter.customers_email_address and customers.email. This result set
is then filtered by the WHERE clause.

--
Oli

[Back to original 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

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