首页 > 代码库 > Mysql MERGE引擎简介
Mysql MERGE引擎简介
CREATE TABLE `test0` (
`uin` int(10) unsigned NOT NULL,
`data` text NOT NULL,
`modtime` int(10) unsigned NOT NULL,
PRIMARY KEY (`uin`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `test1` (
`uin` int(10) unsigned NOT NULL,
`data` text NOT NULL,
`modtime` int(10) unsigned NOT NULL,
PRIMARY KEY (`uin`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `test` (
`uin` int(10) unsigned NOT NULL,
`data` text NOT NULL,
`modtime` int(10) unsigned NOT NULL,
PRIMARY KEY (`uin`)
) ENGINE=merge CHARSET=latin1 UNION=(`test0`,`test1`) INSERT_METHOD=LAST;
INSERT INTO test0 (uin,`data`,modtime) VALUE (3,‘test3333333‘,‘3‘);
INSERT INTO test1 (uin,`data`,modtime) VALUE (2,‘test2222222‘,‘2‘);
INSERT INTO test1 (uin,`data`,modtime) VALUE (2,‘test1111111‘,‘2‘);
SELECT * from test;
Mysql MERGE引擎简介