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
select daybook.userid, count(*) as count from daybook, rating where daybook.userid = rating.userid group by daybook.userid order by count desc
But you dont even really need the daybook table:
select userid, count(*) as count from rating group by userid order by count desc