Good afternoon!
I'm not an expert on mysql - so I doubt it - it might even be silly.
I have a field in a database where a color preference list is stored.
Ex:
Joao prefere: Azul, Verde, Vermelho.
Maria prefere: Verde, Azul, Vermelho
Pedro prefere: Azul, Verde, Vermelho.
In the database I have:
Usuario | Cores
Joao | Azul, Verde, Vermelho
Maria | Verde, Azul, Vermelho
Pedro | Azul, Verde, Vermelho
What do I need to do:
A Ranking showing which colors are preferred by customers.
In this case each color would be punctuated according to your order.
Then in our example:
AZUL: teria 4 pontos (2x 1o lugar + 1 x 2o lugar)
VERDE: teria 5 pontos (2x 2o lugar + 1x 1o lugar)
VERMELHO: teria 9 pontos (3x 3o lugar)
The color with LESS POINTS would be preferred.
Is there any way to do this ranking using only MySQL commands?
I can do this via ASP - it would give me a hard time - so I doubt if it's possible to do this via MySql, to see and it's simpler.
Thank you!