我试图为我正在制作的游戏阶梯写这个声明。在我将团队名称添加到方程式之前,所有内部连接都有效。
SELECT tblMatch.AttackingTeam,
tblMatch.DefendingTeam,
tblTeam.TeamName As AttackingTeamName,
tblTeam.TeamName As DefendingTeamName,
tblGameMaps.MapName AS MapName,
tblGameTypes.TypeShort AS TypeName,
tblStyles.StyleShort AS StyleName,
tblMatch.AttackingScore,
tblMatch.DefendingScore
FROM tblMatch
INNER JOIN tblGameMaps
ON tblGameMaps.MapID = tblMatch.MapID
INNER JOIN tblGameTypes
ON tblGameTypes.TypeID = tblMatch.TypeID
INNER JOIN tblStyles
ON tblStyles.StyleID = tblMatch.StyleID
INNER JOIN tblTeam A
ON A.TeamID = tblMatch.AttackingTeam
INNER JOIN tblTeam B
ON B.TeamID = tblMatch.DefendingTeam
WHERE LadderID=$ladderID AND (DefendingTeam=$teamID OR AttackingTeam=$teamID)
我得到的错误是
“字段列表”中的未知列“tblTeam.TeamName”
数据库确实有一个名为 tblTeam 的表,其中有一列 tblTeamName。也许我只是看不到错误???