INSERT INTO `b_common_member_count` (uid) SELECT uid FROM `b_common_member` WHERE uid NOT IN (SELECT uid FROM `b_common_member_count`) 把b_common_member里的uid,不重复的全部插入到b_common_member_count的uid里.
以下摘自pymongo文档: update_one(filter, update, upsert=False) update_many(filter, update, upsert=False) filter: A query that matches the document to update. update: The modifications to apply. upsert (optional): If True, perform an insert if no documents m
1.insert ignore into 当插入数据时,如出现错误时,如重复数据,将不返回错误,只以警告形式返回.所以使用ignore请确保语句本身没有问题,否则也会被忽略掉=======>INSERT IGNORE INTO user (name) VALUES ('telami') 2.on duplicate key update 当primary或者unique重复时,则执行update语句,如update后为无用语句,如id=id,则同1功能相同,但错误不会被忽略掉=======>I
1.binlog format 启用Row Based Replication(行复制)模式: SET GLOBAL binlog_format = 'ROW'; 如果你想永久的启用这个模式,请修改my.cnf 配置文件: [mysqld] binlog_format=ROW 2.在执行你的sql语句前,设置当前会话的隔离级别 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; INSERT INTO t1 SELECT ....;