我正在尝试对数据集执行以下查询:
SELECT
S.CUSIP, S.SecName,
ISNULL(RA.FinInstCode, '') AS RemarketingAgent,
S.IssueDate, S.MaturityDate, F2.FinInstName AS Trustee,
CASE WHEN SC1.ExpirationDate IS NULL
THEN '' ELSE ISNULL(F1.FinInstCode, '') END
AS CreditProvider,
CASE WHEN SC1.ExpirationDate IS NULL
THEN '' ELSE ISNULL(C1.CreditEnhancementCode, '') END
AS CreditType,
SC1.ExpirationDate AS CreditExpirationDate,
SC1.RefNum AS RefNumber
FROM
dbo.SecurityCreditEnhancementProvider SC1,
dbo.FinInst F1,
dbo.LUCreditEnhancement C1,
{ oj { oj dbo.Security S
LEFT OUTER JOIN
dbo.FinInst F2 ON S.TrusteeID = F2.FinInstID }
LEFT OUTER JOIN
dbo.FinInst RA ON S.RemarketingAgentID = RA.FinInstID }
WHERE
S.SecID = SC1.SecID
AND
SC1.CreditProviderID = F1.FinInstID
AND
SC1.CreditEnhancementID = C1.CreditEnhancementID
AND
C1.CreditEnhancementCode = 'LOC' OR
C1.CreditEnhancementCode = 'LIQUIDITY'
AND
(S.ActiveFlag = 'A')
AND
(S.SecTypeID NOT IN (4, 7))
ORDER BY CreditExpirationDate
尝试运行查询时,我得到的错误是“FROM 子句中的错误:'{'。无法解析查询。”
任何解决此问题的帮助将不胜感激。
谢谢,
编辑 1:这是查询设计器更改代码后的样子:
FROM { oj { oj { oj { oj { oj dbo.SecurityCreditEnhancementProvider SC1 LEFT OUTER JOIN
dbo.FinInst F1 ON SC1.CreditProviderID = F1.FinInstID } LEFT OUTER JOIN
dbo.LUCreditEnhancement C1 ON SC1.CreditEnhancementID = C1.CreditEnhancementID } LEFT OUTER JOIN
dbo.Security S ON S.SecID = SC1.SecID } LEFT OUTER JOIN
dbo.FinInst F2 ON S.TrusteeID = F2.FinInstID } LEFT OUTER JOIN
dbo.FinInst RA ON S.RemarketingAgentID = RA.FinInstID }
谢谢大家的帮助。