You do not use VALUESwhen using the result SELECT:
INSERT INTO tableX (ColumnPk, column1, column2)
SELECT max(columnPk)+1, 'Column value', 'Column2 value';
Is there a reason why you did not configure it columnPkas an auto-increment column, so it will do it automatically?
source
share