3
由於(Department_Code,Course_Code)行,以下查詢給出錯誤「#1241 - 操作數應包含1列」。當我用(Course_Code)代替它時,它可以工作。然而,這不是我想要的GROUP BY CASE的問題
SELECT * FROM Classes
GROUP BY CASE
WHEN (1) THEN
Department_Code
ELSE CASE WHEN (2) THEN
(Department_Code, Course_Code)
ELSE Class_ID
END
END
我怎麼能按Department_Code,當條件(2)滿意是Course_Code?