Reply to Re: [PHP] one more mysql question

Your name:

Reply:


Posted by Philip Hallstrom on 08/13/05 00:52

> I apology for mysql question posted here, but, as I said once, I like you
> guys more! :)
>
> have two tables: orders and special_orders. foreign key is trans_no.
> I can't figure it out how to create a query that pulls orders from the
> "orders" tables that are NOT in "special_orders" table?

I can never remember the syntax, but you want to LEFT JOIN the tables and
then only return rows where the resulting special_orders column is NULL.

something like this (most likely wrong syntax):

SELECT o.trans_no, s.trans_no FROM orders o LEFT JOIN special_orders s ON
o.trans_no = s.trans_no WHERE s.trans_no IS NULL

But that should get you started...

-philip

[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

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