|
I agree with you: it's more elegant, too. I don't understand why WHERE should be more efficient thna JOIN: is that really true: would you please let me know let me know more details ? Sincerely Domenico Finucci Fiditalia , Milano, 02- 4301-2494 -----Messaggio originale----- Da: Dan [mailto:dbcemid@xxxxxxxxx] Inviato: venerdì 28 marzo 2003 16.21 A: Midrange Systems Technical Discussion Oggetto: Re: next baby step in SQL: start using join Ok, guys, I'm seeing two schools of thought here. Dave & Gord say to let the WHERE do the "joining", whereas Rick suggests using JOIN and taking care of file placement in the join. Gord also mentions that using WHERE will cause the query optimizer to determine the best path. I spruced up Rick's example and came up with: Select All T01.JOBNUM, T01.REVNUM, T01.PHSCD, T01.CCPNUM, T01.CCPAMT, T02.CSTTYP From PCPESTCCP T01 join PCPJOBHDR T03 on T01.JOBNUM = T03.JOBNUM join PCPTBLCCP T02 on T03.CMPNUM = T02.CMPNUM and T01.CCPTYP = T02.TBLID and T01.CCPNUM = T02.CCPNUM Where T01.JOBNUM = '3ACM0170' and T02.CSTTYP = 'C' I suppose it gets into personal opinion, but, in this example anyway, I find using the JOIN makes it more apparent that you are joining files and how you are joining them. (vs. using WHERE to do the join.) Comments and advice are welcome & appreciated. - Dan --- "Smith, Dave" <DSmith@xxxxxxxxx> wrote: > Dan: > > The join using the WHERE is no different than the join using the JOIN. (A rose by any other > name....) Within my embedded SQL, I like to use the JOIN operator because it's consistent with > the LEFT OUTER JOIN and EXCEPTION JOIN operators. I must say the more SQL I learn, the more I > love it! > > David Smith > dsmith@xxxxxxxxx __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.