他的回复:
您好,经确认平台暂不支持,建议拆分开写,可以参考以下写法: SELECT t1.confirmedAlarmNum + t2.confirmedAlarmNum AS confirmedAlarmNum, t1.closedAlarmNum + t2.closedAlarmNum AS closedAlarmNum FROM ( SELECT COUNT(CASE WHEN STATUS = 'CONFIRMED' THEN 1 END) AS 'confirmedAlarmNum', COUNT(CASE WHEN STATUS = 'CLOSED' THEN 1 END) AS 'closedAlarmNum' FROM AL_AlarmHistory ) AS t1, ( SELECT COUNT(CASE WHEN STATUS = 'CONFIRMED' THEN 1 END) AS 'confirmedAlarmNum', COUNT(CASE WHEN STATUS = 'CLOSED' THEN 1 END) AS 'closedAlarmNum' FROM AL_Alarm ) AS t2;