我对子查询有以下查询:
SELECT TOP (100) PERCENT Mtg2012.Employee_ID, Mtg2012.Mtg2012, Mtg2011.Mtg2011, Mgr2011.Mgr2011, Mgr2012.Mgr2012
FROM (SELECT TOP (100) PERCENT Employee_ID, Manager_Readiness_Rating AS Mgr2011
FROM dbo.v_sc17_TMS_Data_Career_Meeting_Rating AS v_sc17_TMS_Data_Career_Meeting_Rating_1
WHERE (Plan_Year = 2011)
GROUP BY Employee_ID, Manager_Readiness_Rating) AS Mgr2011 FULL OUTER JOIN
(SELECT TOP (100) PERCENT Employee_ID, Manager_Readiness_Rating AS Mgr2012
FROM dbo.v_sc17_TMS_Data_Career_Meeting_Rating AS v_sc17_TMS_Data_Career_Meeting_Rating_1
WHERE (Plan_Year = 2012)
GROUP BY Employee_ID, Manager_Readiness_Rating) AS Mgr2012 ON Mgr2011.Employee_ID = Mgr2012.Employee_ID FULL OUTER JOIN
(SELECT TOP (100) PERCENT Employee_ID, Meeting_Readiness_Rating AS Mtg2011
FROM dbo.v_sc17_TMS_Data_Career_Meeting_Rating AS v_sc17_TMS_Data_Career_Meeting_Rating_1
WHERE (Plan_Year = 2011)
GROUP BY Employee_ID, Meeting_Readiness_Rating) AS Mtg2011 ON Mgr2011.Employee_ID = Mtg2011.Employee_ID FULL OUTER JOIN
(SELECT TOP (100) PERCENT Employee_ID, Meeting_Readiness_Rating AS Mtg2012
FROM dbo.v_sc17_TMS_Data_Career_Meeting_Rating
WHERE (Plan_Year = 2012)
GROUP BY Employee_ID, Meeting_Readiness_Rating) AS Mtg2012 ON Mtg2011.Employee_ID = Mtg2012.Employee_ID
当我为最后3列运行时,我得到了UNSUPPORTED DATA TYPE ERROR但是对于第一列,我得到了返回的记录。它没有意义,因为它们都是在同一张桌子上建造的。它可以在连接中吗?我整晚都在努力解决这个问题。