MS Access SQL查询 - 查询表达式中的语法错误(缺少运算符)

时间:2021-08-11 15:22:14

I am trying to understand why my query(below) displays an error message in MS Access Sql query editor(sqlview) when I run it.

我试图理解为什么我的查询(如下)在我运行它时在MS Access Sql查询编辑器(sqlview)中显示错误消息。

SELECT *
FROM tblUSPS
INNER JOIN   tblProductUSPS 
ON tblProductUSPS.[PRODUCTUSPS_USPS] = tblUSPS.[USPS_CODE] 
INNER JOIN  tblAttribute 
ON tblUSPS.USPS_ID = tblAttribute.ATTRIBUTE_USPSID

As far as I know the script below if I delete either of the INNER join lines. For instance, this script runs with no errors

据我所知,如果我删除任何一个INNER连接线,下面的脚本。例如,此脚本运行时没有错误

SELECT *
FROM tblUSPS
INNER JOIN   tblProductUSPS 
ON tblProductUSPS.[PRODUCTUSPS_USPS] = tblUSPS.[USPS_CODE] 

And so does this

这样做也是如此

SELECT *
FROM tblUSPS  
INNER JOIN  tblAttribute ON tblUSPS.USPS_ID = tblAttribute.ATTRIBUTE_USPSID

But when I combine, something goes wrong and I am unable to find it so I would like some help identifying this please.

但是当我结合起来时,出现了问题,我无法找到它,所以我想要一些帮助来识别这个问题。

1 个解决方案

#1


10  

Access has strong opinions on parentheses.

Access对括号有很强的意见。

SELECT *
  FROM 
(tblUSPS
INNER JOIN   tblProductUSPS 
   ON tblProductUSPS.[PRODUCTUSPS_USPS] = tblUSPS.[USPS_CODE] )
INNER JOIN  tblAttribute 
   ON tblUSPS.USPS_ID = tblAttribute.ATTRIBUTE_USPSID

#1


10  

Access has strong opinions on parentheses.

Access对括号有很强的意见。

SELECT *
  FROM 
(tblUSPS
INNER JOIN   tblProductUSPS 
   ON tblProductUSPS.[PRODUCTUSPS_USPS] = tblUSPS.[USPS_CODE] )
INNER JOIN  tblAttribute 
   ON tblUSPS.USPS_ID = tblAttribute.ATTRIBUTE_USPSID