query problem
Posted: Fri Jul 18, 2008 2:42 am
I have 3 tables
category, topics, replies
I want to count topics and replies posted in a category
I can get topics count but having problem with replies
here is my query
category, topics, replies
I want to count topics and replies posted in a category
I can get topics count but having problem with replies
here is my query
Code: Select all
SELECT
zzf_category.PK_ID,
count(zzf_topics.PK_ID) AS topics,
zzf_category.catname
FROM
zzf_category
LEFT OUTER JOIN zzf_topics ON (zzf_category.PK_ID = zzf_topics.FK_CATEGORY_ID)
WHERE
zzf_category.catpar = catid
GROUP BY
zzf_category.PK_ID
order by zzf_category.PK_ID asc