mysql> update tasks set task_department = (select project_department from tasks AS t, projects where project_id = task_project); ERROR 1093 (HY000): You can't specify target table 'tasks' for update in FROM clauseSolution:
UPDATE tasks AS t INNER JOIN projects AS p ON t.task_project = p.project_id SET t.task_department = p.project_department;
No comments:
Post a Comment