Question

I want to delete all users who have the email address of @trash-mail.com

How can I do that with a SQL? I'm trying this

DELETE from users    
WHERE email LIKE %trash-mail.com

But it's not working and I really need to be able to delete mass accounts.

Was it helpful?

Solution

You forgot quotes:

DELETE FROM users    
WHERE email LIKE '%trash-mail.com'

See http://www.techonthenet.com/sql/like.php for more information on the LIKE condition.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top