如何使用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'