I know this won\'t work, tried it in various forms and failed all times. What is the simplest way to achieve the following result?
ALTER TABLE XYZ AUTO_INCRE
following the mysql docs, this worked for me in mysql 5.7:
SET @m = (SELECT MAX(id) + 1 FROM ABC); SET @s = CONCAT('ALTER TABLE XYZ AUTO_INCREMENT=', @m); PREPARE stmt1 FROM @s; EXECUTE stmt1; DEALLOCATE PREPARE stmt1;