我想通过主键从mysql中删除记录,即account_recharge_detail_id。当我使用以下脚本时,它有效:SELECT account_recharge_detail_id FROM account_recharge_detail其中operator_name ='fanny-test'; (它返回101)从account_recharge_detail删除,其中account_recharge_detail_id = 101;
但当我加入两者时:DELETE FROM account_recharge_detail其中account_recharge_detail_id in(SELECT A.account_recharge_detail_id FROM account_recharge_detail as A where A.operator_name ='fanny-test')
它返回:错误代码:1093。您无法在FROM子句中为更新指定目标表'account_recharge_detail'
我想用一句话来表达它,我该如何解决它?
我想你可以使用account_recharge_detail中的delete,其中operator_name ='fanny-test';由于account_recharge_detail_id是主键,因此不能为null