I'm somewhat of an experienced simple user of SQL, i.e., never done any joins.

I am now have what appears to be a perfect opportunity to use SQL join to 
greatly simplify my
coding.  Knowing that one can use Retrieve Query Mgmt Query (RTVQMQRY) to take 
a *QRYDFN and
generate the SQL via ALWQRYDFN(*YES), I use WRKQRY to set up the query, get it 
working the way I
want it to, save the *QRYDFN, and use RTVQMQRY to generate the SQL.

So, I am surprised to see that the generated SQL doesn't have any Join clauses 
(?) but, instead,
does the join via WHERE, i.e.:
 FROM      PQPROD/PESTCCP T01, 
           PQPROD/PTBLCCP T02, 
           PQPROD/PJOBHDR T03  
 WHERE     T03.CMPNUM = T02.CMPNUM 
   AND     T01.CCPTYP = T02.TBLID  
   AND     T01.CCPNUM = T02.CCPNUM 
   AND     T01.JOBNUM = T03.JOBNUM 
   AND(    T01.JOBNUM = 'TACM0170' 
   AND     T02.CSTTYP = 'C')       

The join in WRKQRY

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.