From oracle-l-bounce@freelists.org Tue Apr 27 21:27:33 2004 Return-Path: Received: from air189.startdedicated.com (root@localhost) by orafaq.com (8.11.6/8.11.6) with ESMTP id i3S2R7j29309 for ; Tue, 27 Apr 2004 21:27:17 -0500 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air189.startdedicated.com (8.11.6/8.11.6) with ESMTP id i3S2Qv629296 for ; Tue, 27 Apr 2004 21:27:07 -0500 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id ACA5472CED6; Tue, 27 Apr 2004 21:18:54 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12365-36; Tue, 27 Apr 2004 21:18:54 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D272172CEAD; Tue, 27 Apr 2004 21:18:53 -0500 (EST) Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 27 Apr 2004 21:17:39 -0500 (EST) X-Original-To: oracle-l@freelists.org Delivered-To: oracle-l@freelists.org Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D2FF972CC41 for ; Tue, 27 Apr 2004 21:17:38 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11625-95 for ; Tue, 27 Apr 2004 21:17:38 -0500 (EST) Received: from itpub.net (unknown [211.155.30.144]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with SMTP id 8774A72CD94 for ; Tue, 27 Apr 2004 21:17:36 -0500 (EST) Received: (qmail 1570 invoked by uid 0); 28 Apr 2004 02:34:29 -0000 Received: from unknown (HELO oracle) (biti?rainy@218.75.125.194) by 0 with SMTP; 28 Apr 2004 02:34:29 -0000 From: "biti_rainy" To: "oracle-l@freelists.org" Subject: Re: QUERY X-mailer: Foxmail 4.2 [cn] Mime-Version: 1.0 Content-type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit Date: Wed, 28 Apr 2004 10:31:12 +0800 Message-Id: <20040428021736.8774A72CD94@turing.freelists.org> X-Virus-Scanned: by amavisd-new at freelists.org X-archive-position: 3903 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: biti_rainy@itpub.net Precedence: normal Reply-To: oracle-l@freelists.org X-list: oracle-l X-Virus-Scanned: by amavisd-new at freelists.org hi,Seema Singh Any advice are welcome. update main_test a set a.directions =3D(select b.access1 from trail_main b where b.trail_name =3D a.trail_name and b.trail_code =3D a.trail_code) This is updating 6595 rows. you update all the rows in table main_test if the main_test has some rows but the key values not in = trail_main then you will update the directions =3D NULL ; >update main_test a >set a.directions =3D (select access1 from trail_main b > where a.trail_name =3D b.trail_name > and a.trail_code =3D b.trail_code ) >where a.trail_id =3D ANY (select a.trail_id from > vw_trail_main_test a, trail_main= b > where a.trail_name =3D b.trail_name and= a.trail_code >=3D b.trail_code ) this is correct . you can only update the rows in main_test= that the key values in trail_main Best regards yahoo id: feng_chunpei A new dba from china ---- from the mail----- >Hi > >Any advice are welcome. >update main_test a >set a.directions =3D(select b.access1 from trail_main b >where b.trail_name =3D a.trail_name > and b.trail_code =3D a.trail_code) >This is updating 6595 rows. > > >update main_test a >set a.directions =3D (select access1 from trail_main b > where a.trail_name =3D b.trail_name > and a.trail_code =3D b.trail_code ) >where a.trail_id =3D ANY (select a.trail_id from > vw_trail_main_test a, trail_main= b > where a.trail_name =3D b.trail_name and= a.trail_code >=3D b.trail_code ) >This is updating 2599 rows updated. >When I select >select b.access1 from trail_main b >where b.trail_name =3D a.trail_name > and b.trail_code =3D a.trail_code >It returns 2599 rows. > > >Wondering what is wrong? >thx > >________________________________________________________________= _ >FREE pop-up blocking with the new MSN Toolbar =96 get it now! >http://toolbar.msn.com/go/onm00200415ave/direct/01/ > >----------------------------------------------------------------= >Please see the official ORACLE-L FAQ: http://www.orafaq.com >----------------------------------------------------------------= >To unsubscribe send email to: oracle-l-request@freelists.org >put 'unsubscribe' in the subject line. >-- >Archives are at http://www.freelists.org/archives/oracle-l/ >FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html >----------------------------------------------------------------= - > >. =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1 ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request@freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------