|  | Posted by Steve on 09/15/05 13:27 
Yes, I meant that I tried to create a temporary table, not db, sorry...
 Regarding the 3 joins...would putting parenthesis around any of them
 help?
 How are they being processed exactly?
 The first join has a single table reference immediately preceding the
 join statement, but the others cannot (is that correct?)
 What are the next two joins being joined to exacty (since there is no
 table specified before the two join statements?
 
 The tables that I'm joining look like this:
 
 ------FOLIO---------------STAY FOLIO-----------------STAY
 |
 |
 |___________GUEST
 
 All transactions have FOLIO records, but not all transactions have STAY
 FOLIO, STAY, OR GUEST records.
 I need to return all transactions that have a folio record.
 
 This is the syntax I'm using to accomplish this:
 
 mydb.dbo.FOLIO FOLIO
 LEFT OUTER JOIN
 mydb.dbo.STAY_FOLIO STAY_FOLIO
 ON
 FOLIO.folio_id = STAY_FOLIO.folio_id
 LEFT OUTER JOIN
 mydb.dbo.STAY STAY
 ON
 STAY_FOLIO.stay_id = STAY.stay_id
 LEFT OUTER JOIN
 mydb.dbo.GUEST GUEST
 ON
 FOLIO.guest_id = GUEST.guest_id
 
 I don't understand how the order of the joins affects their processing.
 Is there a better way to phrase the joins, given the table
 relationships as outlined above?
 
 Thanks!
 [Back to original message] |