Article

How to delete invalid emails from MYSQL DB

Often times we’ll find ourselves with invalid data in our database and we just want to clean it up. Particularly invalid emails. This SQL query helped us get 1 step closer to deleting invalid emails from our db.

Note: Query only checks for email format and abc@abc.co will pass

Delete e.* From <table_name> e where id in (SELECT id FROM (SELECT id FROM <table_name> WHERE <email_column> NOT LIKE '%_@__%.__%') x)

Article Stats

Real-time insights

1
min read
69
words
Nov 02, 2019
post

Share Article

Spread the knowledge

Quick Actions

Enjoying this?

Get more insights delivered to your inbox