I was wondering today if it was possible to transfer data from one database to another with one query. Say I have two tables:
CREATE TABLE `Table_One` (
`ID` int(11) NOT NULL auto_increment,
`Type_ID` int(11) NOT NULL,
`Title` varchar(255) NOT NULL,
`Date` varchar(100) NOT NULL,
`Address` varchar(100) NOT NULL,
`Town` varchar(100) NOT NULL,
`Desc` longtext NOT NULL,
`Inserted` varchar(100) NOT NULL,
`Updated` varchar(100) NOT NULL,
`User_ID` int(11) NOT NULL,
`Pending` varchar(255) NOT NULL default '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;
and
CREATE TABLE `Table_Two` (
`ID` int(11) NOT NULL auto_increment,
`Title` varchar(255) NOT NULL,
`Town` varchar(255) NOT NULL,
`Desc` varchar(255) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I was thinking of doing something along the lines of
INSERT INTO Table_Two (0,SELECT Title, Town, Desc FROM Table_One)
This didn't seem right though because how would Table_Two know Table_One was in another database? Can I use the schema file to make it a more specific query? Is this even possible to do without using a server side language?
Thanks,
Levi