I have this mysql which works, but I can’t help thinking there’s a better way of doing it?
SELECT u.username, count( c.username ) AS intImageCount
FROM users u
JOIN content c ON c.username = u.username
WHERE (SELECT count( username )FROM content WHERE username = c.username) > 0
GROUP BY u.username
Any suggestions?
You don’t see the need for the subselect and use a LEFT JOIN: