Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: To write a query without using a sub query
you could try
select emp,emp_name from emp
MINUS
select supervisor_emp,supervisor_name from supervisor;
assuming the columns have the same datatypes and formats and MySQL supports set operators.
Or of course you could choose a more advanced RDBMS.
-- Niall Litchfield Oracle DBA Audit Commission UK Legal disclaimer required by my employer **************************************************************************** ** This email contains information intended for the addressee only. It may be confidential and may be the subject of legal and/or professional privilege. Any dissemination, distribution, copyright or use of this communication without prior permission of the addressee is strictly prohibited. **************************************************************************** ** "Prasad Kulkarni" <prasad.kulkarni_at_mailcity.com> wrote in message news:a8274029.0107170449.241355b4_at_posting.google.com...Received on Thu Jul 19 2001 - 08:41:00 CDT
> Hello all,
>
> I am using a free database called 'MySql'. But unfortunately it does
> not support sub queries. Can some one help me to write the query
> without using the sub query.
> For example, my query is something like this:
>
> SELECT emp_name FROM emp
> WHERE emp_num > 0
> and emp_num NOT IN (SELECT supervisor_emp FROM supervisor).