I am rather newbie in SQL and before this moment I only used simple queries, but now I have a problem. I have two tables. First is rating:
id u
You need to do something like this:
SELECT count(id), rating.userid FROM rating JOIN daybook ON daybook.userid = rating.userid GROUP BY userid