Index: openacs-4/contrib/obsolete-packages/bboard/www/forum-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/forum-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/bboard/www/forum-postgresql.xql 29 Jun 2001 20:37:18 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/bboard/www/forum-postgresql.xql 1 Dec 2001 22:25:58 -0000 1.2 @@ -39,18 +39,15 @@ - - select c.category_id, short_name, count(m.message_id) as message_count - from bboard_categories c left outer join - bboard_category_message_map m - on c.category_id = m.category_id - where c.forum_id = :forum_id - and (m.message_id is null - or m.message_id in (select f.message_id - from bboard_forum_message_map f - where f.forum_id = :forum_id)) - group by c.category_id, short_name + select short_name, count(message_id) as message_count, category_id + from bboard_forum_message_map f join + (bboard_categories c left outer join bboard_category_message_map m using (category_id)) + using (message_id) + where f.forum_id = '9758' + group by category_id, short_name + order by category_id; + @@ -79,22 +76,14 @@ - select c.category_id, c.short_name, - count(m.message_id) as message_count - from bboard_categories c left outer join - (select c.category_id, c.message_id - from bboard_category_message_map c, - bboard_forum_message_map f - where c.message_id = f.message_id - and f.status = 'approved' - and f.forum_id = :forum_id) m - on c.category_id = m.category_id - where c.forum_id = :forum_id - and (m.message_id is null - or m.message_id in (select f.message_id - from bboard_forum_message_map f - where f.forum_id = :forum_id)) - group by c.category_id, short_name + select short_name, count(message_id) as message_count, category_id + from bboard_forum_message_map f join + (bboard_categories c left outer join bboard_category_message_map m using (category_id)) + using (message_id) + where f.forum_id = '9758' + and f.status = 'approved' + group by category_id, short_name + order by category_id;