Hi, I have mysql table with links in it. I want to delete links that extension is not .txt. I am wondering if it is possible to delete without retrieve links and check their extension first. Thanks
DELETE FROM relation WHERE attribute NOT LIKE '%.txt' Code (markup): Not sure how efficient this is. You may want to normalise your database schema so you have a relation (table) that holds links and then a separate one that holds their extensions. That way you can perform many operations on the two relations. However, the above should work.