将字段记录从一个表复制到另一个表 [英] copying field records from one table to another

查看:83
本文介绍了将字段记录从一个表复制到另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i ahve表,其中包含用于
的字段
表Cart_details
字段为cart_id,cat_id,数量


我有桌子Order_details
字段为order_id,cat_id,数量



cart_id和order_id都不同,我想将记录(cat_id,quantity)从一个表复制到另一个表.


谁能给我一些想法在mysql

i ahve table with fields for

table Cart_details
with fields as cart_id,cat_id,quantity


and i have table Order_details
with fields as order_id,cat_id,quantity



both cart_id and order_id are different and i want to copy records(cat_id,quantity ) from one table to another .


can anyone give me some idea to implement this in mysql

推荐答案

中插入order_details选择cat_id,从cart_details购买数量
Insert into order_details select cat_id, quantity from cart_details


这篇关于将字段记录从一个表复制到另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆