How to MAX(COUNT(x)) in SQLite
You can use a subquery. Here's how you do it:
- get the number of posts for each blog
- select the maximum number of posts
Example:
select max(num_posts) as max_postsfrom ( select blog_id, count(*) as num_posts from blog_posts group by blog_id) a
(The subquery is in the (...)
).
NB: I'm not a SQLite power user and so I don't know if this works, but the SQLite docs indicate that subqueries are supported.