Imagine two questions from an online survey:
Result stored in mysql db column \"q1\" as
Assuming I'm understanding your question correctly, you could use a case statement:
SELECT CASE WHEN SUM(q1) > SUM(q2) THEN SUM(q1) ELSE SUM(q2) END AS q1Sum,
CASE WHEN SUM(q1) > SUM(q2) THEN SUM(q2) ELSE SUM(q1) END AS q2Sum
FROM myTable
Actually this would mislabel the columns -- you cannot alter the name of the column without using dynamic sql.