表一:
CREATE TABLE log_zz
(
dt
datetime NOT NULL,
info
varchar(100) NOT NULL,
KEY dt
(dt
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
表二:
CREATE TABLE log_xx
(
dt
datetime NOT NULL,
info
varchar(100) NOT NULL,
KEY dt
(dt
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
表三:
CREATE TABLE log_yy
(
dt
datetime NOT NULL,
info
varchar(100) NOT NULL,
KEY dt
(dt
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
关联表:
CREATE TABLE `log_merge` (
`dt` datetime NOT NULL,
`info` varchar(100) NOT NULL,
KEY `dt` (`dt`)
) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 UNION=(`log_zz`,`log_xx`,`log_yy`);
** 这是三张表的数据: **
** 这是关联表的数据: **
** 执行代码 **
查询:select * from log_merge;
删除:delete from log_merge where dt
=’2020-08-10 10:48:53’;
更新:update table where dt
=’2020-08-10 10:48:53’ set info
= ‘SS’;