Gaga Rigs

Deleting multiple rows in MySQL based on id

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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>