Re: Confirmation of SELECT...IN syntax

2003-01-15 Thread Dan Nelson
In the last episode (Jan 15), Doug Beyer said:
 It's my understanding that embedded selects are NOT allowed in MySql. Is this 
correct?
 
 Example:
 
 SELECT t1.* 
 FROM table1 t1 
 WHERE ( t1.Id IN ( SELECT t2.Id FROM table2 t2 ) )

Correct.  Your example can easily be converted to a join, though.

SELECT t1.* from table1 t1, table2 t2 where t1.id=t2.id

-- 
Dan Nelson
[EMAIL PROTECTED]

-
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




RE: Confirmation of SELECT...IN syntax

2003-01-15 Thread Hoffman, Geoffrey
you are correct - subselects are NOT allowed until version 4

until then:

 SELECT t1.* 
 FROM table1 t1 
 LEFT JOIN t2 ON t1.id = t2.id

OR 

 SELECT t1.* 
 FROM table1 t1 
 LEFT JOIN t2 USING (id)

 -Original Message-
 From: Doug Beyer [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 15, 2003 10:55 AM
 
 It's my understanding that embedded selects are NOT allowed 
 in MySql. Is this correct?
 
 Example:
 
 SELECT t1.* 
 FROM table1 t1 
 WHERE ( t1.Id IN ( SELECT t2.Id FROM table2 t2 ) )


-
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




Re: Confirmation of SELECT...IN syntax

2003-01-15 Thread Jeremy Zawodny
On Wed, Jan 15, 2003 at 12:56:39PM -0700, Hoffman, Geoffrey wrote:
 you are correct - subselects are NOT allowed until version 4

4.1 as opposed to 4.0.x.

Jeremy
-- 
Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
[EMAIL PROTECTED]  |  http://jeremy.zawodny.com/

MySQL 3.23.51: up 31 days, processed 1,044,176,442 queries (381/sec. avg)

-
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




Re: Confirmation of SELECT...IN syntax

2003-01-15 Thread Zak Greant
On Wed, Jan 15, 2003 at 12:56:39PM -0700, Hoffman, Geoffrey wrote:
 you are correct - subselects are NOT allowed until version 4

  Subselects will be available in version 4.1

-- 
 Zak Greant [EMAIL PROTECTED] | MySQL Advocate |  http://zak.fooassociates.com

Developing Dynamic Web Applications with MySQL and PHP
  MySQL Training: Paris, March 17-21, 2003
  Visit http://mysql.com/training for more information

GNU/Free Software Foundation (http://www.gnu.org)

-
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