我在 MySql 中有这个语句:
delete from match_custom_field_team_value
where match_id=10648
and match_custom_field_id=14917
and event_id in (2, 6, 8, 4)
and team_id in (select mcfv2.team_id from match_custom_field_team_value mcfv2
where mcfv2.match_id=10648 and mcfv2.match_custom_field_id=14917 and mcfv2.event_id=9);
当我尝试运行它时,我得到:
Error Code: 1093. You can't specify target table 'match_custom_field_team_value' for update in FROM clause
知道为什么会引发错误,以及重写以避免错误的最佳方法吗?(我知道我可以使用临时表来做到这一点,但宁愿不采取额外的步骤。)
谢谢,
贾里德