Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Delete with table-join syntax ?

Re: SQL Delete with table-join syntax ?

From: <shiling_at_math.wayne.edu>
Date: Tue, 22 Jun 1999 15:54:39 GMT
Message-ID: <7kobjp$cdt$1@nnrp1.deja.com>


Why not update B according to A directly?

SQL> select * from t1;

TDATE ID
--------- ---------

19-JAN-96         2
07-JAN-99         3

SQL> select * from t;

TDATE ID
--------- ---------

09-JAN-99         1
08-JAN-99         2
07-JAN-99         3

SQL> l
  1 update t
  2 set tdate = (select tdate from t1 where t1.id=t.id)   3* where id in (select id from t1)
SQL> / 2 rows updated.

SQL> select * from t
  2 ;

TDATE ID
--------- ---------

09-JAN-99         1
19-JAN-96         2
07-JAN-99         3




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Tue Jun 22 1999 - 10:54:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US