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 userid value
1 3 +
1 2 +
1 2 +
And second is daybook:
id userid week day lesson content
1 2 1 1 6 Test!
So now I have a problem. I need to:
1) Join these tables by id.
2) Then order results by count of entries in rating table.
So result must look like:
userid count
3 1
2 2
How to do that? Thanks for anything helpful.
But you dont even really need the daybook table: