I’m trying to delete records from a table that is getting to much spam. So, the idea is delete all records that don’t have email from hotmail, gmail or yahoo. But my sql looks like is returning some hotmail records:
SELECT *
FROM `users`
WHERE email NOT LIKE '*hotmail.com*'
AND email NOT LIKE '*gmail.com*'
AND email NOT LIKE '*ymail.com*'
Applying the OR condition returns the same result. Can you guide to the right direction?
The query should look like this
You have to replace
*by%Here’s the doc about LIKE in MySQL