SQL query

  • From: Mayen.Shah@xxxxxxxxxx
  • To: ORACLE-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 12 Apr 2010 14:57:00 -0400

Hi Listers,

One of my colleagues has challenged me with SQL question. I can not figure 
out how to do this.

SQL> select * from test1;

      COL1       COL2
---------- ----------
        11         21
        12         22
        13         23
        14         25

4 rows selected.

SQL> select * from test2;

      COL3       COL4
---------- ----------
        41         51
        42         52
        43         53
        13         23
        14         25

5 rows selected.

Here is simple query. 

SQL> select col1 from test1 where col1 not in (select col3 from test2);

      COL1
----------
        11
        12

2 rows selected.

I have to rewrite this query where I can't use NOT or MINUS. 

Can anyone help me?

Thanks
Mayen

Other related posts: