mysql数据库去重语句和不同表之间列的复制语句

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;

posted @ 2016-08-24 17:54 无边的天空 阅读(...) 评论(...) 编辑 收藏