Is it possible to set the auto-increment value in MySQL based on a variable?
SELECT 1 + MAX(id)
INTO @newAiValue
FROM Result_Import_Archive;
ALTER TABLE Result_Import
AUTO_INCREMENT = @newAiValue;
This is what I intend to do, however, MySQL complains that it is syntactically incorrect.
LAST_INSERT_ID()
, use this value in the table that has to be linked to this table. And that's it. – tombom May 16 '18 at 12:29