试试这个:
SELECt `AUTO_INCREMENT` INTO @AutoIncFROM INFORMATION_SCHEMA.TABLESWHERe TABLE_SCHEMA = 'database_name' AND TABLE_NAME = 'another_table_name';SET @s:=CONCAt('ALTER TABLE `database_name`.`table_name` AUTO_INCREMENT=', @AutoInc);PREPARE stmt FROM @s;EXECUTE stmt;DEALLOCATE PREPARE stmt;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)