Re: How to delete from table1 where (table1.field1=table2.field2)

From: Bhooshan Prabhu <bhooshan.s.prabhu_at_orbitech.co.in>
Date: 10 May 2002 04:46:15 -0700
Message-ID: <16584988.0205100346.441a153c_at_posting.google.com>


SQL> desc tab1

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 COL1                                               NUMBER(2)

SQL> desc tab2
 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 COL1                                               NUMBER(2) 

SQL> select * from tab1;

      COL1


         1
         2 

SQL> select * from tab2;

      COL1


         1
         2
         3
         4

SQL> delete tab1 a
  2 where exists
  3 (select col1 from tab2 where col1=a.col1);

2 rows deleted.

SQL> select * from tab1;

no rows selected

Regards
Bhooshan

brotherhou_at_yahoo.com (konghou) wrote in message news:<c19678a1.0205091959.35ec3fe7_at_posting.google.com>...
> How to delete from one table where one of the fields equals to a field
> in another table?
Received on Fri May 10 2002 - 13:46:15 CEST

Original text of this message