| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|||
|
This question was posted on [a href="http://www.openwin.org/mike/index.php/archives/2006/05/find-your-most-commented-blog-categories/trackback/"]Mike Hillyer's blog[/a], which he kindly allowed to be posted here.
SELECT wp_categories.cat_name, COUNT(wp_comments.comment_id) +------------------------------------------+-------------------------------+ | cat_name | COUNT(wp_comments.comment_id) | +------------------------------------------+-------------------------------+ | MySQL | 307 | | Visual Basic 6 | 236 | | General | 119 | | Open Source | 43 | | Rants | 42 | | Crystal Reports | 40 | | News | 39 | | Gadgets | 26 | | Windows | 24 | | PHP | 21 | | 2006 MySQL User's Conference & Expo | 13 | | VB.NET | 12 | | 2004 MySQL User's Conference & Expo | 10 | | Reviews | 7 | | 2005 MySQL User's Conference & Expo | 6 | | Photography | 5 | | MySQL Tip of the Week | 4 | | Hardware | 3 | | Money | 2 | +------------------------------------------+-------------------------------+ 19 rows in set (0.16 sec) |