我有三个表,products
,shops
和sex
。我希望DELETE
products 表中的行具有这样的表中product_id
不存在等效项。product_id
sex
此外,表中的这些行的值products
必须shop_id
等于表中值为“www.shop.com”的行。shop_id
shops
shops.shop
到目前为止我有
DELETE FROM products USING shops WHERE
products.shop_id=shops.shop_id AND
shops.shop='www.shop.com' AND NOT EXISTS
(SELECT sex.product_id FROM sex WHERE
sex.product_id=products.product_id)
但似乎products
像我所做的那样在子查询中引用是不可接受的。(我得到错误Unknown table 'products' in MULTI DELETE
。)我该如何解决我的错误?