>Joe,
>
>First of all I am not sure if you need LEFT JOIN for both comments and
>prices. My first example was based on the assumption that you could have
>photos without comments and you might want to display those as well.
>
>It will help if you can paste the entire query and your output code.
>
>Thanks
>
>Qasim
>
>
>>

Yes, not all of the photos will have comments, but all will have prices (and 
the same number of them...8)

Here is what I have so far:

                  <cfquery name="rsPhotoInformation" 
datasource="#application.dsn#">
                        SELECT *
                        FROM photos
                        LEFT OUTER JOIN prices ON
                        photos.photoID = prices.photoID_fk
                        LEFT OUTER JOIN comments ON
                        photos.photoID = comments.photoID_fk
                        
                        WHERE categoryID_fk = <cfqueryparam value="1" 
cfsqltype="cf_sql_integer">
                </cfquery>

And again, here are abbreviated table structures:

photos table
------------------------
photoID
photoTitle

comments table
------------------------
commentID
commentText
photoID_fk

prices table
------------------------
priceID
priceValue
photoID_fk

Thanks again!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284344
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to