在执行下面的查询我收到以下错误删除查询使用IN子句MYSQL
"Lookup Error - MySQL Database Error: You can't specify target table 'customer_copy' for update in FROM clause"
:
Delete from customer_copy where code IN
(select cuc.code from customer_copy cuc
INNER JOIN customer_copy1 cu ON cuc.code = cu.code
where cuc.district=cu.district and cuc.city = cu.city and
cuc.name = cu.name and cuc.country = cu.country and
cuc.customer_grp1 = cu.customer_grp1 and
cuc.email = cu.email and cuc.fax = cu.fax and
cuc.house_number = cu.house_number and
cuc.name=cu.name and cuc.postal_code = cu.postal_code and
cuc.region = cu.region and cuc.street = cu.street and
cuc.tax_juris_code = cu.tax_juris_code and
cuc.tax_number1 = cu.tax_number1 and
cuc.tele = cu.tele and cuc.plant_code = cu.plant_code and
cuc.employee_code = cu.employee_code and
cuc.sales_district_code = cu.sales_district_code and
cuc.sales_office_code = cu.sales_office_code and
cuc.tax_number2 = cu.tax_number2 and
cuc.tax_number3 = cu.tax_number3 and
cuc.search_terms_1 = cu.search_terms_1 and
cuc.search_terms_2 = cu.search_terms_2);
在MySQL数据库
select查询工作正常。什么可能是错的?
如果您想让某人花时间帮助您,那么您应该将其格式化为可读的内容。 – mawburn