创建跨不同数据库的视图

2021-12-29 00:00:00 database mysql view

如果我有数据库D1和数据库D2,以及D1表下的表T1数据库D2下的>T2,是否可以在MySQL数据库D2下创建T1的视图.如果是这样,你能告诉我语法吗?

If I have database D1 and database D2, and table T1 under database D1 and table T2 under database D2, is it possible to create a view of T1 under database D2 in MySQL. If so, can you show me the syntax.

两个数据库在同一台机器上.

Both the databases are on the same machine.

推荐答案

CREATE VIEW `D2`.`example` AS SELECT * FROM `D1`.`T1`;

相关文章