If all your photos will have prices you won't need to left join you can 
just join on them.



Joel Watson wrote:
>> 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!
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

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

Reply via email to