SELECT
CASE
WHEN col1 = MAX_value THEN 'col1'
WHEN col2 = MAX_value THEN 'col2'
WHEN col3 = MAX_value THEN 'col3'
WHEN col4 = MAX_value THEN 'col4'
WHEN col5 = MAX_value THEN 'col5'
END AS max_column_name
FROM
(
SELECT
col1,
col2,
col3,
col4,
col5,
GREATEST(col1, col2, col3, col4, col5) AS MAX_value
FROM your_table
) AS t;
mysql