I have the following Mysql select that returns all the duplicate email addresses in my table.
SELECT users.FirstName, `Surname`, users.email1
FROM users
INNER JOIN (
SELECT email1
FROM users
GROUP BY email1
HAVING count(email1) > 1) dup ON users.email1 = dup.email1
ORDER BY users.email1
This works great, what I wish to do now is update a field called users.DupEmail with "YES" but I am unsure how to do this. I have tried putting an update line to replace the select, but I am clearly getting it wrong as I am back here asking for help.
Can anyone help please?