我有以下形式的存储过程
SELECT key1 AS FirstKey, key2 AS SecondKey FROM table
ORDER BY
CASE @sortOrderParam WHEN 'ASC' THEN
CASE UPPER(@sortColumn)
WHEN 'blabla' THEN FirstKey
WHEN 'blibli' THEN FirstKey, SecondKey --Syntax error
END
END ASC,
CASE @sortOrderParam WHEN 'DESC' THEN
...
END DESC
但是,在某些情况下尝试按两列排序时出现语法错误。我怎样才能做到这一点 ?
谢谢 !