mysql: The target table of the UPDATE is not updatable


目标是批量更新目标表部分字段的数据
操作内容:
1.创建临时表

drop table if exists tempTableXXX 
create table tempTableXXX ( TEMP_ID int not null, BM  varchar(14) )

2.把数据存入临时表
3.把临时数据中的数据存入目标表

update targetTableXXX ,(select * from tempTableXXX ) b set BM=b.BM where b.TEMP_ID=targetTableXXX.ID

4.删除临时表

drop table if exists tempTableXXX 

出现问题:

The target table of the UPDATE is not updatable

原因是update的字段在targetTableXXX中不存在=.=


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM