By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
id | courseid | cmid | userid | vote |
---|---|---|---|---|
9 | 4 | 9 | 3 | 1 |
23 | 4 | 9 | 2 | 1 |
8 | 4 | 10 | 3 | 2 |
22 | 4 | 10 | 2 | 3 |
7 | 4 | 11 | 2 | 3 |
21 | 4 | 19 | 2 | 2 |
courseid | cmid | vote | count(A.vote) |
---|---|---|---|
4 | 9 | 1 | 2 |
4 | 10 | 2 | 1 |
4 | 10 | 3 | 1 |
4 | 11 | 3 | 1 |
4 | 19 | 2 | 1 |