I have an employee table that looks like this:
| id | name | q1 | q2 | q3 | q4 | +----+------+----+----+----+----+ | 1 | John | 20 | 30 | 10 | 4 | | 2 | Ram
Use a "simple" or "switched" CASE statement:
SELECT CASE LEAST(q1, q2, q3, q4) WHEN q1 THEN 'q1' WHEN q2 THEN 'q2' WHEN q3 THEN 'q3' ELSE 'q4' END as chosen_item
In case of ties, the first item in the list will be reported.