我的PHP之旅
The definition of table 'table1' prevents operation UPDATE on table 'table2' 的解决方法
post by:风子 2012-4-1 11:43

The definition of table 'table1' prevents operation UPDATE on table 'table2' 的解决方法

执行下面的SQL,就会报 The definition of table 'table1' prevents operation UPDATE on table 'table2'

update table2 set item = replace(item,'A27-','A28-')
where id in(select id from table1 where
 item like 'A27-%' and status>=1 and online=1)

修改为如下方式即可

update table2 set item = replace(item,'A27-','A28-')
where id in(select id from (select id from table1 where
 item like 'A27-%' and status>=1 and online=1) b)

 

 

 

 

 

 

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容