新建表如下:
CREATE TABLE `ticket` ( `id` bigint(20) unsigned NOT NULL auto_increment, `replace_key` char(1) NOT NULL default '', PRIMARY KEY (`id`), UNIQUE KEY `replace_key` (`replace_key`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=100001;
执行语句
REPLACE INTO `ticket` (`replace_key`) VALUES ('a');SELECT LAST_INSERT_ID();