> > USERS TABLE > > ----------------- > > USER_ID > > USERNAME > > etc... > > > > COMMENTS TABLE > > ------------------------- > > COMMENT_ID > > USER_ID > > COMMENT > > etc... > > > > I know I can query USERS and then loop through the results fetching > > the comments... but I'd rather not do that. Here's the results I'm > > trying to get... in a SINGLE query if possible: > > > > USER_ID,USERNAME,MERGED_COMMENTS > > 1,joe,comment1<br>comment2<br>comment3 > > 2,sam,comment > > 3,sue,comment<br>another comment<br>etc.
<CFQUERY NAME="mergedcomments"> SELECT username, comment FROM users u, comments c WHERE u.user_id = c.userid ORDER BY username </CFQUERY> <CFOUTPUT QUERY="mergedcomments" GROUP="username"> #username#,<CFOUTPUT>#comment#<BR></CFOUTPUT> </CFOUTPUT> Wouldn't that do it? Tony Schreiber, Senior Partner Man and Machine, Limited mailto:[EMAIL PROTECTED] http://www.technocraft.com http://www.is300.net The Enthusiast's Home of the Lexus IS300 since 1999 ***** PARTS STORE NOW OPEN ***** http://www.is300.net/store/ http://www.simplemessageboard.com Free Forum Software for Cold Fusion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

