Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: RE: JOINED UPDATE
The "where COL in (select ...)" is of course also correct (I used "where =
(exists ...)")
The general rule of thumb is to use "IN" if the subquery is small, and =
EXISTS if the results of the IN subquery would be large and the table in =
the subquery has a usable index on the matching column.
You should try both ways on your system and see which query works best.
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org
> [mailto:oracle-l-bounce_at_freelists.org]On Behalf Of system manager
> Sent: mercredi, 11. f=E9vrier 2004 13:00
> To: oracle-l_at_freelists.org
> Subject: Re:RE: JOINED UPDATE
>=20 >=20
>=20
>=20> Original Message
> ----------------------------------------------
>=20> >(select * from temp_savedates
> >The syntax you have below will cause an error in Oracle.
> >
> >Oracle version of your statement would be:
> >update account
> >set (account.expire_dt,
> > account.curr_eff_dt,
> > account.acct_end_dt) =3D3D (select temp_savedates.expire_dt,
> > temp_savedates.curr_eff_dt,
> > temp_savedates.acct_end_dt
> > from temp_savedates
> > where account.acct_num =3D3D temp_savedates.acct_num)
> >where exists
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Wed Feb 11 2004 - 17:22:18 CST
![]() |
![]() |