我有这样的代码:
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
在尝试运行它时,它给了我关于“加入”附近语法不正确的错误。不幸的是,我不知道为什么会出现这样的错误..