I am getting this error,
#1054 - Unknown column 'finalResult' in 'field list'
when ever I run this mysql query
SELECT userID, pickID, nflp_picks.gameID, visitorID, visitorResult, homeID, homeResult,
IF (pickID=visitorID, visitorResult, homeResult) AS finalResult,
IF (finalResult="Winner", 1, 0) AS Win
FROM nflp_picks, nflp_schedule
WHERE nflp_picks.gameID = nflp_schedule.gameID
ORDER BY gameID, pickID, userID
LIMIT 0, 200
Can I not use temporary columns?