no mysql right now (3.23) does not support inner selects.
however, it looks like you could join the 2 tables to get the result you
want
I'm assuming there are 2 tables inside the emp database ? or is emp the
table ?
anyway here is an idea:
select d1.ename, d1.deptno FROM emp.table1 d1, emp.table2 d2 WHERE d1.deptno
= d2.deptno AND d2.ename = 'SCOTT'
-- Andrew
----- Original Message -----
From: "Michael Beaucourt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 11:27 AM
Subject: Inner selects
> Hi all,
>
> I was wondering if it is possible to perform an inner select in MySQL.
> I have a database called EMP and when i enter the following query, I
> keep getting error 1064:
>
> select ename,deptno from emp where deptno in (select deptno from emp
> where ename = 'SCOTT')
>
>
> The error message reads as follows:
> ERROR 1064: You have an error in your SQL syntax near 'select deptno
> from emp where ename='scott')' at line 1
>
>
> Does MySQL support inner select this way or is there another way to
> achieve the same?
>
> Thanks for your help.
>
> Best Regards,
> Michael Beaucourt
> --
>
> ---------------------------------------------------------------------
> 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