I have a table with an auto_increment field and sometimes rows get deleted so auto_increment leaves gaps. Is there any way to avoid this or at the very least write an sql query that a) alters the auto_increment value to be the max(current value) + 1 and b) return the new auto_increment value?
I know how to write part a and b but can I put them in the same query?
If that is not possible or additionally: how do I "select" (return) the auto_increment value or auto_increment value + 1?