COUNT() function with group by
SELECT colum,COUNT(*)
FROM table
GROUP BY grouping colum;
example:
`SELECT COUNT(content.id) as ContentCount
FROM content
JOIN user ON user.id = content.userId
WHERE user.name = 'duRiCha'`;
`SELECT user.name AS name, COUNT(content.body) AS ContentCount
FROM content
RIGHT JOIN user ON user.id = content.userId
GROUP BY name`;