当 a>b获取a,否则获取b,当a>c获取a,否则获取c,b大于c获取b否则获取c
SELECT id,(CASE WHEN a>b THEN a WHEN a>c THEN a WHEN b>c THEN b ELSE c END) as d FROM test2;
SELECT id,(CASE WHEN a>30 THEN '三十' WHEN a>20 THEN '二十' WHEN a>10 THEN '十' ELSE '小于十' END) as d FROM test2;