MS SQL Server STRING_AGG WITHIN GROUP子句语法错误[关闭]

该查询有效

   SELECT Request_ID, STRING_AGG(Proc_Code_Base, ',' ) AS PCB 
          FROM #TEMP_CASE_PROC_LIST l
          GROUP BY Request_ID

But when I add the WITHIN GROUP clause like this

SELECT   Request_ID,
         STRING_AGG(Proc_Code_Base, ',' ) WITHIN GROUP (ORDER BY Proc_Code_Base) AS PCB
FROM     #TEMP_CASE_PROC_LIST l
GROUP BY Request_ID

我懂了

Msg 102,第15级,状态1,第14行      '('附近的语法不正确