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