我在使用此代码时遇到了上述错误。你们对我的代码有什么问题有什么想法吗?它有时会运行,有时我会得到这个错误吗?
SELECT DISTINCT
[Mission_Name]
,MR.[completed_at]
,C.[CustomerNum]
,[CustomerName]
,[TaskTitle]
,[short_str]
,[filepicker]
,[first_name]
,[last_name]
,[TeamName]
,[SalespersonName]
FROM
[PWSETL].[GSC].[MISSION_RESPONSES] AS MR INNER JOIN
[PWSETL].[GSC].[MISSIONS] AS M ON MR.[SITE] = M.[SITE] AND MR.[Mission_ID] = M.[Mission_ID] INNER JOIN
[PWSETL].[GSC].[PLACES] AS P ON MR.[SITE] = P.[SITE] AND MR.[Place_ID] = P.[Place_ID] INNER JOIN
[PWSETL].[odm].[V_Customers] AS C ON C.[SITE] = P.[SITE] AND C.[CustomerNum] = P.[custom_place_id] INNER JOIN
[PWSETL].[GSC].[TASK_RESPONSES] AS TR ON MR.[Mission_Responses_ID] = TR.[mission_response_id] AND MR.[SITE] = TR.[SITE] INNER JOIN
[PWSETL].[GSC].[TASKS] AS T ON TR.[SITE] = T.[SITE] AND TR.[task_id] = T.[Task_ID] INNER JOIN
[PWSETL].[GSC].[USERS] AS U ON U.[Site] = MR.[Site] AND U.[User_ID] = MR.[User_ID] INNER JOIN
[PWSETL].[odm].[Salesperson] AS S ON S.[Site] = C.[Site] AND S.[CustomerNum] = C.[CustomerNum]
WHERE
[Mission_Name] LIKE 'DIAGEO Q3 GM MERCHANDISER MISSION%'
AND MR.[state] = 'COMPLETED'