- d6 n' K+ N( J+ ^* ]- `解决方案: F1 ~ d6 d$ {2 j' e5 l+ r
SELECT bloggers.*,COUNT(post_id) AS post_count FROM bloggers LEFT JOIN blogger_posts ON bloggers.blogger_id = blogger_posts.blogger_id GROUP BY bloggers.blogger_id ORDER BY post_count(注意:MySQL有了特殊的语法,你可以通过GROUP BY针对这种情况,不汇总所有值)。