我正在尝试使用INNER JOIN创建一个视图:
CREATE VIEW [dbo].[MatchingTeamNames]
AS SELECT [XMLSoccer-Team].[ID] AS SoccerID, [XMLSoccer-Team].[Name] AS SoccerName,
[Smarkets-Team].[ID] AS SmarketsID, [Smarkets-Team].[Name]
FROM [XMLSoccer-Team], [MatchingTeamIDs], [Smarkets-Team]
INNER JOIN [MatchingTeamIDs] ON [MatchingTeamIDs].[XMLSoccerID] = [XMLSoccer-Team].[ID]
我收到INNER JOIN最后一部分的错误:[XMLSoccer-Team].[ID]
SQL未解析对象的对象。对象不存在或引用不明确
我出错的任何想法?
感谢。
答案 0 :(得分:1)
使用显式连接语法尝试此查询:
CREATE VIEW [dbo].[MatchingTeamNames]
AS SELECT [XMLSoccer-Team].[ID] AS SoccerID, [XMLSoccer-Team].[Name] AS SoccerName,
[Smarkets-Team].[ID] AS SmarketsID, [Smarkets-Team].[Name]
FROM [XMLSoccer-Team]
INNER JOIN [MatchingTeamIDs]
ON [MatchingTeamIDs].[XMLSoccerID] = [XMLSoccer-Team].[ID]
INNER JOIN [Smarkets-Team]
ON (The Relations between this tables Smarkets-Team and the table its connected to)