Select columns across different databases

前端 未结 2 1229
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 04:29

Is it possible to do a select ( or insert) statement across different databases that are located on the same server? If yes, how?

2条回答
  •  粉色の甜心
    2020-11-27 05:13

    You can select from any other table with a JOIN statement and using this type of syntax.

    SELECT A.*, B.* FROM db1.table1 A LEFT JOIN db2.table1 B ON A.id = B.id
    

提交回复
热议问题