Try select * from QB, relAB where QB.ref = relAB.B and relAB.A='a1'; ----- Original Message ----- From: "Egor Egorov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, February 09, 2002 4:24 AM Subject: is possible 1 query with 2 selects?
> Nuno, > > Friday, February 08, 2002, 11:04:51 PM, you wrote: > > > NT> Hello to all, > > NT> I'm trying to make a query with only one command but I can't see how to do > NT> it. > > [skip] > > NT> What I want to do is get a list from table QB related to an item from > NT> table QA: > > NT> For example, get a list from QB related to item 'a1': > > NT> 1. select B from relAB where A='a1'; > > NT> (result: b2, b3, b4) > > NT> 2. select * from QB where ref in ('b2','b3','b4'); > > NT> (result: only 'a1' related items) > > NT> There is a way of make this query with only one command? > > NT> Something like: > > NT> 1. select * from QB where ref in (select B from relAB where A='a1'); > > MySQL doesn't curently support sub-selects, look at: > http://www.mysql.com/doc/A/N/ANSI_diff_Sub-selects.html > > It is in our plans to support sub-selects in future: > http://www.mysql.com/doc/T/O/TODO_MySQL_4.1.html > > NT> Please help me in this matter. > NT> Thanks very much, > > > > > > -- > For technical support contracts, goto https://order.mysql.com/ > This email is sponsored by Ensita.net http://www.ensita.net/ > __ ___ ___ ____ __ > / |/ /_ __/ __/ __ \/ / Egor Egorov > / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] > /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net > <___/ www.mysql.com > > > > --------------------------------------------------------------------- > 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 > > > --------------------------------------------------------------------- > 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 _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com --------------------------------------------------------------------- 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