我有两个表看起来与这些表相似
成员
CREATE TABLE IF NOT EXISTS `members` (
`ID` int(10) unsigned NOT NULL auto_increment,
`email` varchar(255) NOT NULL,
`password` varchar(100) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
存档成员
CREATE TABLE IF NOT EXISTS `archived_members` (
`ID` int(10) unsigned NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(100) NOT NULL,
`archived_date` timestamp NOT NULL,
`archived_type` varchar(20) NOT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=utf8 ;
我通常使用此查询语句在表之间移动行这只是一个示例
INSERT INTO `archived_members` (`ID`, `email`, `password`) SELECT * FROM `members` WHERE `ID`=1;
DELETE FROM `members` WHERE `ID`=1;
archived_members
但在我的情况下(这种情况),我必须为表中的其他字段指定值archived_date
& archived_type
。因此,我尝试了
INSERT INTO `archived_members` (`ID`, `email`, `password`) SELECT * FROM `members` WHERE `ID`=1;
UPDATE `archived_members` SET `archived_date`=CURRENT_DATE(), `archived_type`='reason of archving' WHERE `ID`=1;
DELETE FROM `members` WHERE `ID`=1;
不幸的是,我认为应该是ARCHIVEarchived_members
的表引擎,因此在将行插入表后我无法更新它们。
请帮忙!