我試圖找到最優化的方式來做到這一點的操作運行在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