简体   繁体   English

java.sql.SQLException:表被指定了两次,既作为“更新”的目标,又作为数据的单独源

[英]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.

相关问题 表名称指定两次作为更新目标和单独的数据源 - Table name specified twice both as a target for update and separate source for data 表被指定两次,既作为 &#39;UPDATE&#39; 的目标,也作为单独的数据源 - Table is specified twice, both as a target for 'UPDATE' and as a separate source for data 表被指定两次,既作为&#39;UPDATE&#39;的目标,又作为单独的数据源 - Table is specified twice, both as a target for 'UPDATE' and as a separate source for data MySQL-表两次指定为更新目标和单独数据源 - MySQL - table specified twice both as a target for update and as a separate source for data 表名指定两次,既作为更新的目标,又作为单独的数据源 - Table name specified twice, both as a target for update and as a separate source for data 表被指定两次,既作为 &#39;UPDATE&#39; 的目标,也作为 mysql 中数据的单独源 - Table is specified twice, both as a target for 'UPDATE' and as a separate source for data in mysql SQL-#1093-表&#39;&#39;被指定两次,既作为&#39;UPDATE&#39;的目标又作为数据的单独来源 - SQL - #1093 - Table '' is specified twice, both as a target for 'UPDATE' and as a separate source for data 该表被两次指定为INSERT的目标和单独的数据源 - table is specified twice both as a target for INSERT and as separate source of data 表&#39;tbl_name&#39;被指定两次,既作为&#39;UPDATE&#39;的目标,又作为数据的单独源 - Table 'tbl_name' is specified twice, both as a target for 'UPDATE' and as a separate source for data 错误: <table_name> 指定两次,既作为“ UPDATE”的目标,又作为单独的数据源 - Error : <table_name> specified twice, both as a target for 'UPDATE' and as a separate source for data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM