background preloader

MySQL

Facebook Twitter

Sum sql for data in multiple columns and across rows for Total & Percentage. SQL Fiddle. How to reset AUTO_INCREMENT in MySQL to lower than the maximum current ID. First published on January 1, 2008 In short, you cannot and should not.

How to reset AUTO_INCREMENT in MySQL to lower than the maximum current ID

In MySQL, if you have a column that is assigned the AUTO_INCREMENT count, you can reset that count by using this statement (or check out the Operations tab in phpMyAdmin): ALTER TABLE tablename AUTO_INCREMENT=0 However, if you have existing rows, the AUTO_INCREMENT value will only reset to one higher than the maximum current ID. UPDATE « Table Join « MySQL Tutorial.