i work on sql server 2012
i get error as below:
The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns.
statement generate error
INSERT INTO [ExtractReports].dbo.AllData(PartID,Code,CodeTypeID,RevisionID,ZPLID,FeatureName,FeatureValue,ConCount) SELECT PartID,Code,Co.CodeTypeID,Co.RevisionID,Co.ZPLID, STUFF((SELECT + CAST(d.ColumnName AS VARCHAR(300)) AS [text()]
FROM [ExtractReports].dbo.PartAttributes t1 with(nolock)
inner join core_datadefinitiondetails d with(nolock) on t1.ZfeatureKey=d.columnnumber
WHERE t1.PartId = PM.PartId
FOR XML PATH(')), 1, 1, NULL) AS Featurekey,
STUFF((SELECT + CAST(O.Name AS VARCHAR(300)) AS [text()]
FROM [ExtractReports].dbo.PartAttributes AS O
WHERE O.PartId = PM.PartId
FOR XML PATH(')), 1, 1, NULL) AS FeatureValue,Count(1) as ConCount
FROM
[ExtractReports].dbo.PartAttributes PM
INNER JOIN [ExtractReports].dbo.Condition Co ON Co.ZfeatureKey = PM.ZfeatureKey Where (1=1 and (PM.ZfeatureKey= 1501170111 And Name ='Zener') ) Group By PartID,Code,Co.CodeTypeID,Co.RevisionID,Co.ZPLID Having Count(1)>= 1
so why this statement generate that error
How to solve issue