码迷,mamicode.com
首页 > 其他好文 > 详细

msyql

时间:2020-04-21 14:49:43      阅读:55      评论:0      收藏:0      [点我收藏+]

标签:tor   tail   dual   key   tutorial   sts   tutorials   man   ica   

数据唯一性

先建立primary index或者unique index:
INSERT IGNORE
REPLACE

https://www.tutorialspoint.com/mysql/mysql-handling-duplicates.htm

https://www.mysqltutorial.org/mysql-insert-ignore/
https://www.runoob.com/mysql/mysql-handling-duplicates.html

INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDAT cut = cut +1

INSERT INTO books (name) SELECT ‘MySQL Manual‘ FROM dual WHERE NOT EXISTS (SELECT id FROM books WHERE id = 1)

https://blog.csdn.net/java_2017_csdn/article/details/78517789

msyql

标签:tor   tail   dual   key   tutorial   sts   tutorials   man   ica   

原文地址:https://www.cnblogs.com/zhouj-happy/p/12744450.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!