0LIMITing deletes
suggest changeDELETE 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents