That statement should have given you a syntax error. If you are trying to find the number of times a given user id has written to the forum, use this:SELECT COUNT(*) FROM Forum WHERE UserId = @UserId;
For all usersSELECT UserId,COUNT(*) FROM forum WHERE GROUP BY UserId;
For a user given the username:SELECT
COUNT(*)
FROM
Users U
INNER JOIN Forum f ON f.UserId = u.UserId
WHERE
u.Username = 'JaneDoe';