我有3个表(provider,provider_has_product,product):
我尝试使用此代码进行除法运算:
SELECT DISTINCT `provider_has_product`.`provider_id` FROM `provider_has_product` WHERE NOT EXIST
(SELECT * FROM `product` WHERE NOT EXIST
(SELECT * FROM `provider_has_product` A1 WHERE
A1.`provider_id` = `provider_has_product`.`provider_id` AND
A1.`product_id` = `product`.`id`))
但它不起作用。它显示:Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM
产品WHERE NOT EXIST
(SELECT * FROM
provider_has_p'位于第2行
如何在MySQL上进行除法并纠正此错误。
答案 0 :(得分:3)
检查拼写错误。我很确定它是EXISTS
,而不是EXIST