我有這樣的代碼:附近有語法錯誤「加入」
Select
C.ClientId
,K.NameShort
,C.SetId
,C.CaseId
,C.ClientCaseNumber
,D.Name
,Pay.Overpayment
from CaseDetails as C
where (C.ClientId = @ClientId or @ClientId IS NULL) and (C.SetId = @SetId or @SetId IS NULL)
join Client as K on C.ClientId = K.ClientId
join DocumentDetails as DD on C.CaseDetailsId = DD.CaseDetailsId
join PaymentDocumentHistory as Pay on DD.DocumentId = Pay.DocumentId
join DebtorDetails as D on C.CaseDetailsId = D.CaseDetailsId
試圖運行它,它給了我錯誤關於不正確的語法附近「加入」。不幸的是,我不知道爲什麼會出現這樣的錯誤。
看看t-sql'SELECT'語法[這裏](http://technet.microsoft.com/en-us/library/ms189499.aspx) – AgentSQL