I have a table called Emails and a table called BadList.
In the table Emails it has 1 field called EmailAddress which has over 300,000 email addresses.
In the table BadList it has 1 field called Domain which has around 500 domains like “@123.co.uk”.
I’m not sure how to do what i need to do so I need your help please. I need a MySQL Query that will list all the email addresses found in the table Emails that match any of the domains listed in the table BadList.
I know your going to have to use the WHERE EmailAddress LIKE ‘%BadListValue%’
Thanks for your response, sorry my fault i should start again. Below is the query im using.
JOIN emails ON emails.Email LIKE CONCAT( ‘%’, badlist.domain )
LIMIT 0 , 2000
emails is the table name and Email is the field name. Everything works fine if i use the SELECT function, but if i just change the SELECt to DELETE then thats the error i get. I’m not sure why its looking for a table called Email as im saying the table is called emails and the field is called Email.
Thanks again for your response, but im confused and not sure what i need to do it delete them, there’s over 1700 records when i run the SELECT command, but i need those records delete that match the select query. I’ve tried selecting them all in PHPMYADMIN and deleting them but that doesnt work, iv tried exporting them, that doesnt work. I’m stuck