可能重複:
The multi-part identifier could not be bound多部分組成的標識符無法綁定
這是我的查詢,不希望工作。
它說: 無法綁定多部分標識符「dbo.RunSequenceBatch.RunSequenceBatchName」。
您能否提供建議?
在此先感謝! :)
SELECT '30 May' AS [Date],
[RunSeq].[RunSequenceBatchName] AS [Batch Job Name] ,
RunSeqCat.CategoryDescription AS [Development Name] ,
[Systems].SystemName AS [System Area] ,
CAST((SUM(DumpSM37_Env3.Duration)/60) AS NUMERIC(10, 2)) AS [Duration (mins)]
FROM [dbo].[RunSequenceBatch] AS RunSeq
LEFT JOIN DumpSM37_Env3 ON ([RunSeq].[RunSequenceBatchName] = DumpSM37_Env3.[Job]
AND DumpSM37_Env3.[ImportDate] BETWEEN '30 May 2012 00:00:00' AND '30 May 2012 23:59:59'),
[dbo].[RunSequenceType] AS RunSeqType,
[dbo].[RunSequenceFrequency] AS RunSeqFrequency,
RunSequenceCategory AS RunSeqCat, Category, [Systems]
WHERE RunSeq.Status = 'Active'
AND RunSeqFrequency.RunSequenceBatchID = RunSeq.RunSequenceBatchID
AND RunSeq.RunSequenceTypeID = RunSeqType.RunSequenceTypeID
AND RunSeqCat.CategoryDescription = Category.Description
AND Category.SystemArea = [Systems].SystemID
AND DumpSM37_Env3.[Duration] > 0
AND RunSeq.RunSequenceTypeID = 1
AND RunSeqCat.RunSequenceBatchID = RunSeq.RunSequenceBatchID
GROUP BY dbo.RunSequenceBatch.RunSequenceBatchName, DumpSM37_Env3.WorkerProcessID,
ORDER BY [RunSeqFrequency].[Frequency] ASC,
[RunSeqFrequency].[StartTime] ASC
可能是一個錯字,但你有RunSeq.RunSequenceBatchName和進一步在您的查詢RunSequence.RunSequenceBatchName。似乎是不同的名稱相同? –
考慮在查詢中使用簡短的別名。這可能會使您的查詢更具可讀性(即使對您自己),因此更容易發現此類錯誤。 –