SELECT ISNULL(dbo.NCR.Id, '') AS Id, ISNULL(dbo.NCR.NCR, '') AS Ncr, ISNULL(dbo.NCR.AcctgDate,, ISNULL(dbo.NCR.InvestigatorId, '') AS InvestigatorId, ISNULL(dbo.NCR.MORId, '') AS MorId, ISNU
我在SELECT语句中添加了最后一个UNION (带有ncr_actual_dev的一个),它只在表被声明时才会导致错误。如果我单独运行整个SELECT语句(粗体中的部分),它就完成了,没有问题。product_code, 'CD' AS Stage, ncr_actual_cd WHERE ncr_actual_cdWHERE ncr_actual_cca IS NOT NULL
UNION ALL SELECT prod