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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9e9a4-19ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9e9a4-19ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?