I have a table which contains ratings. Included with the rating is data the user provided such as the language that the linked series belongs to.
id series_id language quality type rating
1 18 1 2 1 20
2 18 2 3 2 13
3 18 1 1 2 25
4 18 1 3 5 8
5 18 3 1 1 17
6 18 3 3 2 9
What would be the best way to find the most common value for language, quality and type, for a certain series_id?
In other words, if I was looking at series 18, it would return the following as those numbers occur the most.
language: 1
quality: 3
type: 2