We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Auto reset of auto-incrementing field after delete of any field

asked 2018-06-20 06:39:30 +0200

koolninja gravatar image

is there any way to auto-incrementing field get auto reset after delete of any field

suggestion expected


edit retag flag offensive close merge delete


Are you looking for a general solution independent from database used (Mysql, internal HSQLDB etc.) or you are working with a spceific DB? The approach will be different. Specific solution may work faster.

Xoristzatziki gravatar imageXoristzatziki ( 2018-06-20 06:53:49 +0200 )edit


koolninja gravatar imagekoolninja ( 2018-06-20 11:45:19 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-06-22 07:34:22 +0200

Xoristzatziki gravatar image

updated 2018-06-22 07:36:37 +0200

Try this. Search for restart. The best is to create a trigger that will restart counter after a delete is made.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-06-20 06:39:30 +0200

Seen: 159 times

Last updated: Jun 22 '18