I have two tables. Group, and Content
I want to show all Groups, and only 3 rows from Content even if there are more.
similar to..
Cars - Benz
Cars - Honday
Cars - Toyota
Sports - Soccer
Sports - Football
Sports - Basketball
Currently i have this:
SELECT g.id, g.name category, c.c_title as content, c.c_group
FROM groups g
INNER JOIN content c ON c.c_group = g.id
WHERE c.approved = 1
ORDER BY g.name
What should be done to the above statement to
get only 3 rows per group from the content table?