Mysql self-increasing field, how to reset it

A field that increments itself from 0, how to get it to start counting again under certain conditions (starting from 0), instead of emptying the database,
has several of this field.

for a stir-fry Mini Game, the user"s stir-fry field is added once. The number of the whole stir-fry cycle is not fixed, some are more or less.
A stir-fry cycle ends. This field is counted from 0.

how to build such a field

Thank you!

Mar.03,2021

you can try:

ALTER TABLE tablename AUTO_INCREMENT=-1;

I hope I can help you.

Menu