17,382
社区成员




SQL>
SQL> col c1 format a10;
SQL> col c2 format a10;
SQL> col c3 format a10;
SQL> create table t1(c1 int, c2 int, c3 int);
Table created
SQL> create table t2(c1 int primary key, c2 int, c3 int);
Table created
SQL> insert into t1 values(1,2,3);
1 row inserted
SQL> insert into t1 values(2,2,3);
1 row inserted
SQL> insert into t2 values(1,2,3);
1 row inserted
SQL> insert into t2 values(2,2,3);
1 row inserted
SQL> delete from (select t1.* from t1 inner join t2 on t1.c1 = t2.c1);
2 rows deleted
SQL> select * from t1;
C1 C2 C3
---------- ---------- ----------
SQL> select * from t2;
C1 C2 C3
---------- ---------- ----------
1 2 3
2 2 3
SQL> drop table t1 purge;
Table dropped
SQL> drop table t2 purge;
Table dropped
SQL>