Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Are these SQL statements equivalent?
deanbrown3d wrote:
> If I have a SQL statement:
>
> -----------------------------------------------------
> update TRAIN_ROUTE_MQ TRMQ
> set (TRAIN_I, P_VERSION_I) =
> (
> select TRAIN_I, P_VERSION_I
> from TRAIN_MQ MQ
> where MQ.TRAIN_IMP_I = TRMQ.TRAIN_IMP_I
> and MQ.LOCKED_PROJECT_I = " + XXXXXXXXXXXXXX
> )
> where TRMQ.LOCKED_PROJECT_I = iCurrentProject;
> -----------------------------------------------------
>
> Is there any difference between setting the XXXXXXXXXXXXXX to:
>
> iCurrentProject
>
> or
>
> TRMQ.LOCKED_PROJECT_I
>
> Thanks for any info,
>
> Dean
>
Did you check the EXPLAIN PLAN for each version?
I'm guess that using the iCurrentProject would be more efficient but not really sure. I could maybe argue either way, but it's the optimiser that has the final say.
-- Ed Prochak running http://www.faqs.org/faqs/running-faq/ netiquette http://www.psg.com/emily.html -- "Two roads diverged in a wood and I I took the one less travelled by and that has made all the difference." robert frostReceived on Tue Jun 28 2005 - 22:24:35 CDT