How to make a view with tables of different databases?

0

I know that my question is basic, but I want to know how to do a view that returns me certain fields of 3 tables that are in different BD, 2 of these tables are from one database and the remaining table from another database. I hope you can help me, thank you.

    
asked by Ab Hdez 16.03.2018 в 23:35
source

1 answer

0

You could create a temporary table and there store the data you need from the tables that are required to consult your temporary table at the end

CREATE TEMPORARY TABLE tu_tabla(  tu_campo1 VARCHAR (100),
                                  tu_campo2 INT (100),
                                  tu_campo3 DATETIME,
                                  tu_campo4 VARCHAR(100),
                                  tu_campo5 INT(100),
                                  tu_campo6 VARCHAR(100),
                                  tu_campo..N INT(100))

Obviously given the little information in your question it would be necessary to treat your data, verify that the columns have the same type of data ... ETC, but at a great rate is only one possibility.

    
answered by 16.03.2018 в 23:55