语法错误,内部连接缺少运算符
Posted
技术标签:
【中文标题】语法错误,内部连接缺少运算符【英文标题】:Syntax error missing operator on inner join 【发布时间】:2014-04-01 06:53:04 【问题描述】:我做了以下查询:
SELECT [tbl_Imp_tabel WBS WPE.Verantwrd], [tbl_Imp_tabel WBS WPE.WBS_Id], [tbl_Imp_tabel WBS WPE.Koptekst], [tbl_Users.UserName], [tbl_Users.WPENaam]
FROM [tbl_Imp_tabel WBS WPE]
INNER JOIN [tbl_Users]
ON tbl_Imp_tabel WBS WPE.Verantwrd = tbl_Users.WPENaam ;
但是,我的访问告诉我,我的线路上缺少一个操作员:
ON tbl_Imp_tabel WBS WPE.Verantwrd = tbl_Users.WPENaam ;
知道如何解决这个问题吗?
提前致谢
【问题讨论】:
【参考方案1】:您忘记了 ON 子句中表名 [tbl_Imp_tabel WBS WPE.Verantwrd] 周围的方括号。 Usage of [ ] in SQL
SELECT [tbl_Imp_tabel WBS WPE.Verantwrd], [tbl_Imp_tabel WBS WPE.WBS_Id], [tbl_Imp_tabel WBS WPE.Koptekst], [tbl_Users.UserName], [tbl_Users.WPENaam]
FROM [tbl_Imp_tabel WBS WPE]
INNER JOIN [tbl_Users]
ON [tbl_Imp_tabel WBS WPE.Verantwrd] = tbl_Users.WPENaam ;
【讨论】:
【参考方案2】:ON 子句中的表名周围缺少方括号
试试这个
SELECT [tbl_Imp_tabel WBS WPE].[Verantwrd], [tbl_Imp_tabel WBS WPE].[WBS_Id], [tbl_Imp_tabel WBS WPE].[Koptekst], [tbl_Users.UserName], [tbl_Users.WPENaam]
FROM [tbl_Imp_tabel WBS WPE]
INNER JOIN [tbl_Users]
ON [tbl_Imp_tabel WBS WPE].[Verantwrd] = tbl_Users.WPENaam ;
【讨论】:
以上是关于语法错误,内部连接缺少运算符的主要内容,如果未能解决你的问题,请参考以下文章