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 [email protected] will pass
Delete e.* From <table_name> e where id in (SELECT id FROM (SELECT id FROM<table_name>
NOT LIKE '%[email protected]__%.__%') x)