Bekijk deze MySQL-artikel over hoe te werken met de top N dingen in willekeurig complexe groeperingen; het is goed spul. Je kunt dit proberen:
SET @counter = 0;
SET @category = '';
SELECT
*
FROM
(
SELECT
@counter := IF(posts.category = @category, @counter + 1, 0) AS counter,
@category := posts.category,
posts.*
FROM
(
SELECT
*
FROM test
ORDER BY category, date DESC
) posts
) posts
HAVING counter < 2