Question1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Lifehacks

Q&A for people looking to bypass life's everyday problems with simple tricks

/*SELECT UserId, COUNT(UserId) AS numBadges
FROM Badges
WHERE UserId < 10
GROUP BY UserId;
*/
SELECT Users.Id, COUNT(Badges.UserId) AS numBadges
FROM Users
INNER JOIN Badges
ON Users.Id = Badges.UserId
WHERE Users.Id < 10
GROUP BY Users.Id;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results