Belatar Yassine Belatar Yassine - 5 months ago 20
SQL Question

Delete from where record is like

everybody, i have a table like this:

id | img
1 | 20/23/link.png
2 | 20/24/link.png
3 | 20/23/link.png


I want to delete all records where ing starts with 20/23. How can I do this ?

Answer
DELETE FROM TABLENAME WHERE IMG LIKE '20/23%'

You may have to set the safe update to 0.

SET SQL_SAFE_UPDATES = 0;

But set it back to 1 after you deleted records.

Comments