开发者

Skip error while bulk inserting

开发者 https://www.devze.com 2022-12-12 06:45 出处:网络
I am using following query to bulk insert from one table to another. INSERT INTO billitems SELECT * FRO开发者_C百科M billitems_old;

I am using following query to bulk insert from one table to another.

INSERT INTO billitems SELECT * FRO开发者_C百科M billitems_old;

I want that if insert fails on any row, it must skip that row and proceed. Is there anything that I can include in the above query to skip errors.


insert ignore into billitems select * from billitems_old;

reference: insert


From the online documentation:

If you use the IGNORE keyword, errors that occur while executing the INSERT statement are treated as warnings instead.

So try:

INSERT IGNORE INTO billitems SELECT * FROM billitems_old
0

精彩评论

暂无评论...
验证码 换一张
取 消