[英]Copy data from one table of one database to onother table of other database
Hello i know that are answers about my question but i cannot figure it out. 您好,我知道这是关于我的问题的答案,但我无法弄清楚。 So i need help.
所以我需要帮助。 I have to databases, Database A and B.
我要数据库A和B。
Database A has structure
table AT and columns
A1
A2
A3
A4
Database B has structure
table BT and columns
B1
B2
B3
B4
how i can make the query to copy all the data from database B and table BT to database A and table AT? 我如何进行查询以将所有数据从数据库B和表BT复制到数据库A和表AT?
i now is something like 我现在有点像
select * into [databaseTo].dbo.tablename from [databaseFrom].dbo.tablename
but i don't know how to right it. 但我不知道如何纠正。 Thank you
谢谢
Then 然后
INSERT INTO A.AT (A1, A2, A3, A4)
SELECT B1, B2, B3, B4
FROM B.BT
should do the work. 应该做的工作。 Your MySQL user needs privileges for both databases of course.
您的MySQL用户当然需要两个数据库都具有特权。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.