INSERT INTO invoice
SELECT invoiceid, customerid
FROM accountinginvoice where invoiceid='0380'
我尝试了这个,但是发生了错误
Column count doesn't match value count at row 1
请帮助我。我在两个表中有很多不同的列和大量数据
最佳答案
/*
Here we got 2 tables, Table1 and Table2.
we are selecting Table1.userName and Table2.Userid into a new BackupData Table.
The folloiwing is a straight forward query and i hope this helps.
*/
SELECT Table1.UserName, Table2.UserID
INTO BackupData
FROM Table1
LEFT JOIN Table2
ON Table1.UserID=Table2.UserID;
关于mysql - 如何在 mysql,vb.net 中将不同字段从一个表插入到另一个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28711193/