Question about SQL "WHERE IN" syntax:

I know that something like this is fine to do:

(1)
SELECT foo 
FROM   bar
WHERE  fooID in ('1','2')

In the example above, the parenthesis includes the itemized fooID's.  But, I
want to do a similar thing where instead of the actual fooID's in the WHERE
IN clause, I reference a column that contains the fooID's, like:

(2)
SELECT foo 
FROM   bar
WHERE  fooID in (bar.fooID)

In this example, I have the table 'bar' and the column 'fooID'.

Is (2) possible?  If not, what other strategies are there?  Please help.

PSA




---------------------------------------------------------------------
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