LOW_PRIORITY/DELAYED/HIGH_PRIORITY/IGNORE

Posted by 猪头小队长 | 程序设计 | Friday 27 October 2006 14:43

偶然的机会,发现了mysql的insert语句中还可以使用IGNORE,就像这样:
insert ignore into table_a(c1,c2) values(’a',’b');
insert ignore into table_a(c1,c2) values(’a',’c');
这个表里面c1是key。

这种语句在某些场合相当有用。查了一下,同样的关键字还有:LOW_PRIORITY/DELAYED/HIGH_PRIORITY/IGNORE,居然还有中文文档,哈哈:
http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html#insert

还有ON DUPLICATE KEY UPDATE,这个关键字也比较有用。

[@more@]

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.