I have a query that is giving me a bit of a problem.

<cfquery datasource="#request.theDSN#" name="theHistory">
        SELECT * 
        FROM History
        LEFT OUTER JOIN Op ON History.Op_ID = Op.Op_ID
        LEFT OUTER JOIN TravelerD ON History.TravelerD_ID = TravelerD.TravelerD_ID
        LEFT OUTER JOIN Notes ON History.History_ID = Notes.History_ID
        WHERE History.Device_ID = #theLot.Device_ID#
        ORDER by History.Date_Out
</cfquery>


TravelerD and Notes both share a field named TravelerD_ID.

When there is not a matching Notes record, theHistory.TravelerD_ID from the query 
field ends up empty even though there is a TravelerD record that matches the query... 
the 2nd left outer join relates to it.

How does one query tables that share common field names in this case. I can't seem to 
work out the alias technique here.

As an aside.... 
history.op_id ALWAYS has a match in op
history.travelerd_id does NOT always have a match in travelerd
history.history_id does NOT always have a match in notes
am I using the Left Outer Join properly here?

thanks,
Brian





______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to