我只想回顯文章並按用戶評論的最多數量排序。這是我的兩個表同時從另一個表中選擇數據和計數
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