[英]java.sql.SQLException: Table is specified twice, both as a target for 'UPDATE' and as a separate source for data
update input_workshop_tasks iw
set iw.priority_condition1_time = (select iw2.priority_condition1_time
from input_workshop_tasks iw2
where iw2.task_id=7
and iw2.workshop_id =1892)
where iw.task_id=12
and iw.workshop_id =1892
Produced Error: Table name specified twice both as a target for update and separate source for data.产生的错误:表名被指定两次作为更新的目标和单独的数据源。
How can I fix this as in other similar question, the setting of the attribute was not done using the same table?我该如何解决这个问题,就像在其他类似问题中一样,属性的设置不是使用同一个表完成的?
update input_workshop_tasks iw,
input_workshop_tasks iw2
set iw.priority_condition1_time = iw2.priority_condition1_time
where iw.task_id = 12
and iw.workshop_id = 1892
and iw2.task_id = 7
and iw2.workshop_id = 1892
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.