SELECT CASE
WHEN 'XIYAO' = 'XIYAO' THEN
'XIYAO'
END XIYAO,
CASE
WHEN 'ZHONGYAO' = 'ZHONGYAO' THEN
'ZHONGYAO'
END ZHONGYAO,
CASE
WHEN 'QITA' = 'QITA' THEN
'QITA'
END QITA
FROM DUAL;
------解决方案--------------------
加个sum(),然后再group by id
SELECT ID,sum(decode(LXMC,'检查',JE,NULL)) AS '检查',....FROM table GROUP BY ID