MySQL将一个表的数据插入到另外一张表中
作者:互联网
需求:将A表中指定查询条件的数据,插入到B表中。
INSERT INTO ap_base_categories ( category_name, category_id, parent_id, `level`, tree, site_code, created_at, is_leaf, platform ) SELECT category_name, category_id, parent_id, `level`, tree, site_code, created_at, is_leaf, platform FROM ap_categories WHERE platform = 1 AND site_code = 'MY';
注意:字段要一一对应。
标签:category,code,platform,表中,site,插入,MySQL,id 来源: https://www.cnblogs.com/camg/p/16512519.html