我试图找到最优化的方式来做到这一点的操作运行在SQL语句访问,VBA:优化SQL查询中VBA
SQl = "UPDATE " _
& "MainTable As T1 " _
& "INNER JOIN TableOfLists As T2 " _
& "ON (T2.SecondList = T1.MultiValuedList.value) " _
& "Set [FOUND IN LISTS] = 'YES' "
DoCmd.RunSQL SQl
SQl = "UPDATE " _
& "MainTable As T1 " _
& "INNER JOIN TableOfLists As T2 " _
& "ON (T2.FirstList = T1.MultiValuedList.value) " _
& "Set [FOUND IN LISTS] = 'YES' "
DoCmd.RunSQL SQl
此代码的工作,能够可靠地改善,但我没有无法找出如何。
我到目前为止已经试过,结果我得到了:
- Adding 2 INNER JOIN但我得到一个语法错误3075
- Adding 2 conditions separated by an OR in the INNER JOIN condition,但我得到一个错误3081:不能参加超过1表
- This was my previous solution using 2 SELECT statements但我 得到了推荐使用JOIN代替
欢迎任何建议!
你的意思是在((T2.SecondList = T1.MultiValuedList.value))或(T2.FirstList = T1.MultiValuedList.value)???? –
是的,括号没有任何区别 – Seb
我的意思是“括号”的“括号” – Seb