我有以下查询,适用于 MySQL:
DELETE `test1`, `test2`, `test3`, `test4` FROM
`test1` LEFT JOIN `test2` ON test2.qid = test1.id
LEFT JOIN test3 ON test3.tid = test2.id
LEFT JOIN test4.qid = test1.id
WHERE test1.id = {0}
但它不适用于 MS Access。我尝试在周围添加括号LEFT JOIN
,但它在 FROM 子句中给了我语法错误。
那么这个查询应该是什么样子才能在 MS Access 中工作呢?
Access DELETE 需要星号 (*):DELETE * FROM ...
此外,连接必须使用括号嵌套:
DELETE test1.*, test2.*, test3.*, test4.*
FROM
(
(
test1
LEFT JOIN test2 ON test1.qid = test2.id
)
LEFT JOIN test3 ON test2.tid = test3.id
)
LEFT JOIN test4 ON test1.qid = test4.id
WHERE test1.id = {0}
这是特定于 Access (Jet) SQL 的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)