我有两张表结构如下:
history表--
-- 表的结构 `history`
--CREATE TABLE `history` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) character set utf8 collate utf8_unicode_ci NOT NULL,
  `createtime` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
history_temp表--
-- 表的结构 `history_temp`
--CREATE TABLE `history_temp` (
  `id` int(11) NOT NULL auto_increment COMMENT '编号',
  `h_id` int(11) NOT NULL COMMENT 'histroy表ID',
  `name` varchar(50) character set utf8 collate utf8_unicode_ci NOT NULL COMMENT 'histroy表name',
  `createtime` datetime NOT NULL COMMENT 'histroy表createtime',
  `regtime` datetime NOT NULL COMMENT '执行时间',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
我想写一个存储过程,从history表里取出值,存放到history_temp表里。history_temp表有一个regtime字段,还要记录一下存放时间。请各位前辈指教!