insert into phone2(ph,attr,type,carrier) select top 1000 ph,attr,type,carrier from phone 将表phone的字段和前1000条数据复制到Phone2表 数据库中的某个表删除重复数据(phone2表不能存在) select distinct * into phone2 from phone 表phone的数据放到phone2中(phone2表可以存在) insert into phone2(ph,attr,ty
1.去重语句:DELETE FROM `v_klg_item` WHERE id NOT IN (SELECT * FROM (SELECT MAX(id) FROM `v_klg_item` GROUP BY NAME) AS tmp); 2.数据库不同表之间列的复制语句:INSERT INTO crm_add (id,address,pid) SELECT id,NAME,parentId FROM labos_area;
MySQL将一张表的某些列数据,复制到另外一张表 INSERT INTO t_topic_content(content,topicId) SELECT content,id FROM t_topic; 注意:给某一列数据赋值,自增长,那么就不应该插入数据了 MySQL将一张表的某些列数据,复制到另外一张表,并且修改某些内容.方法同上, 只是查询的时候使用REPLACE(str,from_str,to_str) 函数 INSERT INTO t_topic_content(content,t