>First write your sql as
>
>SELECT p.photoID, p.photoTitle, c.commentId, c.commentText
>FROM    photos p
>                 LEFT OUTER JOIN comments c
>                     ON c.photoid_fk = p.photoid
>ORDER BY p.photoID, c.commentID
>
>Then output the query using cfoutput and group like this
>
><ul>
><cfoutput query="yourQuery" group="photoID">
>   <li>#photoTitle#</li>
>      <ul>
>      <cfoutput>
>         <li>#commentText#</li>
>      </cfoutput>
>      </ul>
></cfoutput>
></ul>
>
>HTH
>
>Qasim
>
>>

Qasim--

That worked brilliantly.  However, I still have one problem.  Now I need to be 
able to join a nearly identical table on photos in the same way as the 
comments. 

This other table is called "prices" and looks like this:

prices table
---------------------
pricesID
pricesValue
photoID_fk

I thought that duplicating what I had done with your example would work.  
However, when I try to do this:

LEFT OUTER JOIN prices ON photos.photoID = prices.photoID_fk
LEFT OUTER JOIN comments ON photos.photoID = comments.photoID_fk

....the "prices" data groups properly, but the "comments" data shows only one 
record per grouping, whereas it shows the expected number if the "prices" join 
is removed.

I thank you for your help so far!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 beta – Build next generation applications today.
Free beta download on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284332
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