I have tried both methods from the wiki entry. I have very little experience with writing SQL queries so don’t know where to go from here.
Test Page
The first method does not populate the counts while the second method does.
This is the template code:
<h2>Method One</h2>
<p>{exp:weblog:categories weblog="about_us"}<br />
<a href="http://{path=about_us/details}">{category_name}</a> {exp:query sql="SELECT count(exp_category_posts.entry_id) AS post_count FROM exp_category_posts WHERE exp_category_posts.cat_id = {category_id}"}({post_count} entries){/exp:query}<br />
{/exp:weblog:categories}</p><h2>Method Two</h2>
<p><ul><br />
{exp:query sql="SELECT count(exp_category_posts.entry_id) AS post_count, exp_category_posts.cat_id, exp_categories.cat_name<br />
FROM exp_categories, exp_category_posts, exp_weblog_titles WHERE exp_category_posts.cat_id = exp_categories.cat_id AND parent_id='0'<br />
AND exp_weblog_titles.weblog_id = '9'<br />
AND exp_weblog_titles.entry_id = exp_category_posts.entry_id<br />
GROUP BY exp_categories.cat_name"}<br />
<li><a href="http://{path=about_us/details}C{cat_id}/">{cat_name}</a> ({post_count} {if post_count > 1}entries{if:else}entry{/if})</li><br />
{/exp:query}
Any help is greatly appreciated.