Mysql 使用临时列执行以下查询时出错

Mysql 使用临时列执行以下查询时出错,mysql,sql,sql-server,Mysql,Sql,Sql Server,我知道这看起来有点简单,但我在执行此查询时遇到了以下错误: SELECT 'NOC Service Request Acknowledgement - All severities' AS [Problem_Type_Name(Parent) Category] ,[Job_ticket_id] ,CASE WHEN (case when [Escalated to Resolved time] is null then (ISNULL([Escalated to Resolved time],

我知道这看起来有点简单,但我在执行此查询时遇到了以下错误:

SELECT 'NOC Service Request Acknowledgement - All severities' AS [Problem_Type_Name(Parent) Category]
,[Job_ticket_id]
,CASE WHEN (case when [Escalated to Resolved time] is null then (ISNULL([Escalated to Resolved time],0) + ISNULL([Escalated to Closed time],0)- ISNULL([hold time],0)) else (ISNULL([Escalated to Closed time],0) - ISNULL([hold time],0)) end) <0THEN 0 ELSE (case when [Escalated to Resolved time] is null then (ISNULL([Escalated to Resolved time],0) + ISNULL([Escalated to Closed time],0)- ISNULL([hold time],0)) else (ISNULL([Escalated to Closed time],0) - ISNULL([hold time],0)) end)  END AS JobTime
,[Time to Accept SLA]
,[Report_Date]
,[Problem_Type_Name(Parent)]
,[Problem_Type_Name(Child)]
,[Assigned Tech]
,[PRIORITY_TYPE_NAME]
,[Close_Date]
,[NAME]
,[Ticket Status]
,[Escalated to Closed time]
,[Escalated to Resolved time]
,[Hold Time]
,case when String_value in ('Warning' ,'Critical') then String_value else null end  as 'String_value'
,[PROBLEM_TYPE_ID]
FROM TEMP_TICKET_STATE_Category
join ticket_custom_field custom1 on custom1.entity_id = job_ticket_id
join custom_field_definition custom_definition1 on custom_definition1.id=custom1.definition_id  
WHERE [Problem_Type_Name(Parent) Category] IN ('NOC Service Request Acknowledgement - Urgent','NOC Service Request Acknowledgement - High',
'NOC Service Request Acknowledgement - Medium','NOC Service Request Acknowledgement - Low')
选择“NOC服务请求确认-所有严重性”作为[问题类型\名称(父)类别]
,[Job\u ticket\u id]
,案例当(案例当[升级到解决时间]为空时,则(ISNULL([升级到解决时间],0)+ISNULL([升级到关闭时间],0)-ISNULL([保留时间],0))其他(ISNULL([升级到关闭时间],0)-ISNULL([保留时间],0))结束)[问题类型\名称(父)类别]


不是要应用的列,其中

包括您得到的错误。否则,我们只是猜测。