Deleting multiple rows in MySQL based on id

May 29, 2009 | No Comments
Share |

so i had table that was filled with spam after ID 22, meaning i wanted to delete everything after ID 22

here is the a simple line you can query to delete them all

DELETE FROM  `volunteers` WHERE  `volunteers`.`id` >22 LIMIT 1000 ;

so my table is called volunteers, and the controlling field is id,
the greater than 22 means to delete everything that has a id greater than 22
the limit part controls how many rows the query will effect

May 29, 2009 | No Comments
Share |

Leave a Reply