0LIMITing deletes

suggest change
DELETE FROM `table_name` WHERE `field_one` = 'value_one' LIMIT 1

This works in the same way as the ‘Delete with Where clause’ example, but it will stop the deletion once the limited number of rows have been removed.

If you are limiting rows for deletion like this, be aware that it will delete the first row which matches the criteria. It might not be the one you would expect, as the results can come back unsorted if they are not explicitly ordered.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents