【发布时间】:2020-09-18 20:26:52
【问题描述】:
我正在努力获取列名以获得跨列的最高测试分数。
我已经设法获得了 max_score
select *, max(Test_1, Test_2, Test_3) as max_score
from result_table;
但我需要的是列名。我有很多列要比较,所以我想避免使用
case when (Test_1 > Test_2) and (Test_1 > Test_3) then 'Test_1'
我想要的结果是黄色的。
【问题讨论】: