The following query select groups of forums (conferences), forums which contain 
threads and messages. I needed the query to return also the number of forums 
for each conference, total number of threads for each conference and the total 
number of messages for each conference. This numbers are going to be used to 
calculate the level of global activity for each "conference". Thank for the 
help.

select 
conferences.id,
conferences.name,
conferences.description,
conferences.active,
conferences.membersonly, 
conferences.sort_order
from 
((conferences left JOIN forums ON conferences.id =
forums.conferenceidfk) left JOIN threads ON forums.id = threads.forumidfk)
left JOIN messages ON threads.id = messages.threadidfk

where   conferences.active = 1

GROUP BY 
conferences.id,
conferences.name,
conferences.description,
conferences.active, 
conferences.membersonly,
conferences.sort_order
order by 
conferences.sort_order 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3301
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to