I am trying to do an IF function in MySQL that i thought would be pretty straightforward, but seems to be a little for complex.
Here's the idea:
SELECT IF(score1>score2, (name1,score1,name2,score2),(name2,score2,name1,score1))
AS (winner,w_score,loser,l_score)
FROM game table
what I am trying to do is test score1 > score2, depending on the result, order the fields I want.
IF. You should probably do that outside of the query, like in PHP (or whatever language you're using).