Hi.

On Thu, Apr 12, 2001 at 09:39:46PM -0400, [EMAIL PROTECTED] wrote:
> The following works ok in SQL Server, can it work in mySQL?
> 
> select * from users where id in (select userid from group where name='sales')

Sub-selects are not (yet) supported by MySQL. But you can rewrite that
query to (assuming userid is unique within one group):

SELECT  *
FROM    users u, group g
WHERE   u.id = g.userid AND
        g.name = 'sales'

Please read the fine manual. This is already is explained at several
places, one of them being the tuturial.


Bye,

        Benjamin.


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