ERROR 1093 (HY000): You can’t specify target table ‘message’ for update in FROM clause
报错:
ERROR 1093 (HY000): You can't specify target table 'message' for update in FROM clause
原sql:
update user_invite set level=2 where parent_id in (select user_info_id from user_invite where level=1);
需要加个临时表解决:
update user_invite set level=2 where parent_id in (select user_info_id from (select user_info_id from user_invite where level=1) as puid);