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 if not, at the very least, how to write an SQL query that:
- Alters the
auto_incrementvalue to be the max(current value) + 1
- Return the new
I know how to write part 1 and 2 but can I put them in the same query?
If that is not possible:
how do I "select" (return) the
auto_increment value or
auto_increment value + 1?