Results 1 to 3 of 3
Nov 30, 2001, 21:05 #1
How to delete X number of rows in mySQL
I have a table with three fields: name, password, textstr. This table has grown to about 4500 rows, and I need to delete the FIRST 3000 rows. (and leave the last, latest 1500 in the table).
I am using phpMyAdmin and want to know if there's a script/query I can write for this that will do this automatically instead of me having to manually click on 3000 Delete buttons!?!?!?!
Any help would be appreciated.
Nov 30, 2001, 21:59 #2
- Join Date
- Oct 2001
- Eureka, CA. USA
- 0 Post(s)
- 0 Thread(s)
I am guessing you have used a KEY (maybe something like: ID), and if so, than just run the following command:
DELETE FROM table_name WHERE ID BETWEEN 1 AND 2999
You can do that from within phpMyAdmin
Last edited by AbelaJohnB; Nov 30, 2001 at 22:02.John B. Abela
Dec 2, 2001, 13:40 #3
Ok bad news --- I have no ID key assigned.
Any other way??? Can't I just POP out the first 1000 or something e..g like u can pop stuff from an array when programming?