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

Home -> Community -> Usenet -> c.d.o.server -> Re: Help me double check this query. Please?

Re: Help me double check this query. Please?

From: Vrajesh Patel <vrajesh_p_at_hotmail.com>
Date: Tue, 07 Dec 1999 18:00:54 GMT
Message-ID: <qXb34.44$gC3.5956@pm02news>


Use exists, will perform better result and processing time.

 update table1 t1 set column_a = 1
 where exists (select 1 from table2 t2

                 where t1.rec_id = t2.rec_id
                  and t1.rec_Date = t2.rec_Date)


"Greg Akins" <gakinsNOgaSPAM_at_gatewayhealthplan.com.invalid> wrote in message news:09920fb9.06801268_at_usw-ex0102-013.remarq.com...
: Hi,
:
: I have a query which is updating one field in a record, if two fields
: in that record match 2 fields in a record of another table.
:
: Basically:
:
: update table1 t1 set column_a = 1
: where T1.rec_id in (select rec_id from table2 t2
: where t1.rec_id = t2.rec_id )
: and t1.rec_date in (select rec_date from table2 t2
: where t1.rec_Date = t2.rec_Date)
:
: Does this do what I expect it to? Is there a cleaner way to accomplish
: this?
:
: Any help would be appreciated.
:
: -greg
:
:
: * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
: The fastest and easiest way to search and participate in Usenet - Free!
:
Received on Tue Dec 07 1999 - 12:00:54 CST

Original text of this message

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