I have an SQLite table blog_posts. Every blog post has an id and blog_id.
If I want to know how many blog posts every blog has:
SELECT blog_id, count(1) posts FROM blog_posts group by blog_id
What do I do if I want to know how many posts the blog with the most posts has? (I don’t need the blog_id.) Apparently this is illegal:
SELECT max(count(1)) posts FROM blog_posts group by blog_id
I’m pretty sure I’m missing something, but I don’t see it…
Other solution:
I’m not sure which solution would run faster, if this one or the one with the subquery.