I have 10000 categories of posts and 1200000 posts (each post has publication dae). I want to get date of most recent post for each category using one or two SQL queries. This is structure of database:
Categories +--+----+ |id|name| +--+----+ CategoriesToPosts +--------+----+ |category|post| +--------+----+ Posts +--+------------+- -+ |id|lastModified| ... | +--+------------+- -+