Reply to writing an outer join query?

Your name:

Reply:


Posted by laredotornado on 02/24/06 00:48

Hello,

Not sure what an outer join query is, but would it apply here? How
would I write a query, given these two tables and data

CATEGORIES
--------------------
CATEGORY_ID
1
2

PRODUCTS
-----------------
PRODUCT_ID CATEGORY_ID SALE_PRICE
A 1 NULL
B 1 13.50
C 2 NULL

I would like to write a single MySQL query to indicate that a category
has at least one product with a non-null sale price but also return a
result for the categories that don't. Ideally, with the above data, my
result set would look like

CATEGORY_ID HAS_SALE
1 Yes
2 No

Any ideas how I can do this? Using MySQL 4, PHP 4. Thanks, - Dave

[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

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