mysql php sort by highest of 3 separate fields -


i've got table 3 separate scores in 3 separate fields:

user / score 1 / score 2 / score 3 person 1: 10 21 7 person 2: 17 4 20 person 3: 1 5 22 

is there mysql command sort each person out highest score 3 fields.

so here need return:

person 3: 1 5 22 person 1: 10 21 8 person 2: 17 4 20 

the way can think of doing put them in array, check each number each person against each other find highest, sort them different array.

this seems long-winded , labour intensive though.

add order greatest(score1,score2,score3) desc

manual greatest()


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -