下面的查询抛出标题中提到的错误:
SELECT
Set_To_Value_ID,
CASE
WHEN Set_To_Variable_ID IS NOT NULL THEN Set_To_Variable_ID
WHEN Changed_In_SP IS NOT NULL THEN Changed_In_SP
WHEN Comment_Input IS NOT NULL THEN ( Select Comment FROM Process_Instance WHERE Process_Instance_ID = @Process_Instance_ID )
END AS Manual_Value
FROM Variables
WHERE Some_Irrelevant_Value = @Some_Irrelevant_Value
我知道错误来自 Comment_Input 案例,因为这是应该从那里返回的值。