Mark Breen
marklbreen at gmail.com
Thu Feb 24 07:31:43 CST 2005
Hello List,
As some of you may have seen, I am currently working on a project that
is using Access 97 and Oracle 8i. Having seen a lot of use of the
Where Exists predicate in here, I thought I should try to get my head
around it, so, I went on to the trusty web and guess who's article I
came across, our very own Ms Harkins.
So, to take my question back to our list, which of the following two
SQL statements would you guys use. Basically, I am trying to see the
benefit or cost of using Where Exists
Thanks, hope you find it interesting and if you have any comments to
make fire them back, if not, no problem, do not worry about it, this
is not holding me up.
Susan, thanks for your contribution to the world and subsequently, to
me. BTW, the two ladies in the photo are really pretty !
Notes
ED_RCPT_TMP_DTLS contains 10,000 records
HSET_TACS contains 720 Records
Option 1
Update chs.ED_RCPT_TMP_DTLS
Set (MODEL_CODE) =
Select MODEL_CODE
From HSET_TACS
Where
)
Where Exists (
Select * from HSET_TACS, ED_RCPT_TMP_DTLS
Where HSET_TACS.TAC_CODE = ED_RCPT_TMP_DTLS.TAC_CODE
)
Option 2
Update chs.ED_RCPT_TMP_DTLS
Set (MODEL_CODE) =
(
Select chs.MODEL_CODE
From HSET_TACS
Where HSET_TACS.TAC_CODE = ED_RCPT_TMP_DTLS.TAC_CODE
)