mysql[192.168.11.187] processid[249] root@localhost in db[zjzc] hold transaction time 197 112069858,250,insert into ClientActionTrack20151125(clientSn,ip,url,httpMethod,requestParams,requestHeader,pageUrl,sessionId,startTime,completeTime) values(11,'…
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里.…
INSERT INTO wx_announcement_push ( title, content, STATUS, del_flag, user_login_name ) SELECT '大家好', '我是曹XXX', , ', su.login_name FROM sys_user su WHERE su.fen_xiao_Id IS NOT NULL AND su.fen_xiao_Id != ''…
1. 语法介绍 有三张表a.b.c,现在需要从表b和表c中分别查几个字段的值插入到表a中对应的字段.对于这种情况,可以使用如下的语句来实现: INSERT INTO db1_name (field1,field2) SELECT field1,field2 FROM db2_name 上面的语句比较适合两个表的数据互插,如果多个表就不适应了.对于多个表,可以先将需要查询的字段JOIN起来,然后组成一个视图后再SELECT FROM就可以了: INSERT INTO a (field1,…