![]() Next, locate the highest value for the auto_increment column (say it is id) SELECT MAX(id) maxid FROM mydb. I want to delete records saved in my phpmyadmin but I got an error when executing sqlcommands executenonquery () This is my code used in VB. ![]() The following statement deletes duplicate rows and keeps the highest id: DELETE t1 FROM contacts t1 INNER JOIN contacts t2 WHERE t1.id < t2.id AND t1.email t2. How to delete database records in phpmyadmin Ask Question Asked 10 years, 10 months ago Modified 9 years, 10 months ago Viewed 1k times 2 I am new in VB.net, sql and even phpmyadmin gui. In phpmyadmin, just click the SQL tab, enter the command, and run it.įor a nonempty table, you may want to adjust the auto_increment attribute to the highest existing id in use in case higher entries were deleted.įirst, optimize the table OPTIMIZE TABLE mydb.mytable MySQL provides you with the DELETE JOIN statement that allows you to remove duplicate rows quickly. ![]() If you want to hose the data, then be my guest. Since this one of the most frequently asked questions for phpmyadmin, you can learn more about this in this blog : Supplemental Infoįor an empty table, another way to reset the auto_increment attribute is to run TRUNCATE TABLE mydb.tablename ĭon't run this if you have data in it. Click on the Go button for the Table Options box.Enter the new auto_increment starting value.In the Table Options box find the auto_increment field.Second, use a condition to specify which rows to delete in the WHERE clause. In phpMyAdmin, click on the table you want to reset or change the AUTO_INCREMENT value First, specify the table from which you delete data.Perhaps you could just select the phpMyAdmin Operations tab:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |