开发者

Skip error while bulk inserting

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜