如何使用Mysql将值从一个表插入另一个表 [英] How Do I Insert Values From One Table Into Another Using Mysql
本文介绍了如何使用Mysql将值从一个表插入另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个具有相同和不同字段的表。我想将两个表合并为一个,请给出一个最简单的查询来完成这个过程
I have two tables with same and different fields . I want to merge the two table into one please give an easiest query to complete this process
INSERT INTO invoice (
invoiceid
)
VALUES (
(SELECT invoiceid
FROM accountinginvoice where invoice_gid='s5678433;))
这是我的查询这项工作仅适用于我想要合并不同字段的相同字段
this is my query this work only for same fields i want to merge different fields
推荐答案
试试这个..
1)使用表单将数据从一个mysql表插入到另一个mysql表中
2)在mysql中将数据从一个表插入另一个表
试试这个:
Try this:
INSERT INTO invoice (invoiceid)
SELECT invoiceid FROM accountinginvoice where invoice_gid='s5678433'
这篇关于如何使用Mysql将值从一个表插入另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文