Marcos Henke Wrote:

> SELECT a.* FROM company a, employee b
> WHERE a.id=b.cid AND
> (b.name='joe' OR
> b.name='bill');

This will pull out all companies which have a Joe or a Bill.  We want only the
 company in which Joe and Bill are working.  

A working solution was offered by Adolfo Bello earlier with a (maybe) typo. here's the 
edited version:

Select a.* from company a, employee b, employee c where
a.id = b.cid and
a.id = c.cid and
b.name = 'Joe' and
c.name = 'Bill;

Thanks
Nasser.

sql, smallint






---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to