1

I need to create a MySQL table with view from deferent database table. Is it possible? If yes how?

Data1.Table1 has 6 columns. I need to use this 6 columns and about 20 new other field with Data2.Table2. Is it possible? If yes how?

peterh
  • 11,875
  • 18
  • 85
  • 108
sathees
  • 11
  • 1
  • 2
  • Not sure about what you asking. Would this help you? http://stackoverflow.com/questions/5698378/mysql-join-between-tables-in-2-different-databases – Christian Gollhardt Mar 13 '15 at 00:24

1 Answers1

0

Yes it is possible if you're database is in one server, give some ALIASES to the two tables. Please see example below:

SELECT tbl1.col1,tbl1.col2,tbl1.col3,tbl1.col4,tbl1.col5,tbl1.col6, tbl2.*
FROM DB1.TBL1 AS tbl1
INNER JOIN DB2.TBL3 AS tbl2 ON tbl1.ID = tbl2.ID;
RBB08
  • 126
  • 5