0

is there any similar syntax to this in mysql:

insert into database2.table1 (column1, column2) select column4, column5 from database2.table1;

Bart
  • 4,830
  • 16
  • 48
  • 68
  • possible duplicate of [Oracle Database Link - MySQL Equivalent ?](http://stackoverflow.com/questions/1565993/oracle-database-link-mysql-equivalent) – duffymo Nov 17 '10 at 00:12
  • there's only one database in your example.. did you mean insert into database2.table1 (column1, column2) select column4, column5 from database1.table1 – Ben Nov 17 '10 at 00:22
  • @duffymo, that question inspired me for a solution using views, thanks for that – Bart Nov 17 '10 at 00:25
  • @ben: my mistake , they are two – Bart Nov 17 '10 at 00:26
  • that might be what he meant, but it works either way – jon_darkstar Nov 17 '10 at 00:26

2 Answers2

0

looks good. are you getting an error?

jon_darkstar
  • 16,398
  • 7
  • 29
  • 37
0

I create a view for the columns I wanted to copy

than i run this query:

insert into database2.table1 (column1, column2) select * from database1.view;

Bart
  • 4,830
  • 16
  • 48
  • 68