我只想回显文章并按用户评论的最多数量排序。这是我的两个表同时从另一个表中选择数据和计数
tbl_articles
article_id | articles_title |
1 | This is 1st |
2 | This 2nd |
tbl_comment:
comment_id | user_id | article_id | comment_msg
1 | 1 | 1 | my comment1
2 | 1 | 2 | my comment2
3 | 2 | 1 | some comment1
如何加入这些表,并迫使这样的结果
article_id|articles_title| comment_count |
1 | This is 1st | 2 |
2 | This 2nd | 1 |
感谢
您是否还想按comment_count排序结果,即在结果列表中首先评论最多的文章? – 2013-04-24 15:56:36