List:General Discussion« Previous MessageNext Message »
From:Adolfo Bello Date:December 2 2002 11:52pm
Subject:RE: WHERE IN SYNTAX
View as plain text  
Isn't this sort of impossible?
You are asking for something like "a set which contains as an element
the set itself"

	WHERE fooId IN (fooId)

Adolfo

> -----Original Message-----
> From: Peter Abilla [mailto:peter-abilla@stripped] 
> Sent: Monday, December 02, 2002 1:43 PM
> To: mysql@stripped
> Subject: sql:WHERE IN SYNTAX
> 
> 
> 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 <mysql-thread126320@stripped>
> To unsubscribe, e-mail 
> <mysql-unsubscribe-adolfobello=bisapi.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 
> 

Thread
sql:WHERE IN SYNTAXPeter Abilla2 Dec
  • RE: WHERE IN SYNTAXAdolfo Bello3 Dec
    • Re: WHERE IN SYNTAXPeter Abilla3 Dec
  • Re: sql:WHERE IN SYNTAXRodney Broom3 Dec