Last active
April 17, 2018 13:07
-
-
Save thedarsideofit/17756d9faad32c5356e08aaac21e8484 to your computer and use it in GitHub Desktop.
buscar-repetidos-actualizar-dominios.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Verificar si va a haber emails repetidos al cambiar todos a @yopmail | |
------------------------------------------------------------------------------------------------- | |
SELECT REPLACE(email, SUBSTRING_INDEX(email, '@', -1), 'yopmail.com') as nuevo_email, count(*) as cant | |
FROM `email` | |
GROUP BY nuevo_email | |
HAVING cant > 1 | |
--Actualizar todos los emais a @yopmail | |
------------------------------------------------------------------------------------------------- | |
UPDATE email | |
SET email = REPLACE(email, SUBSTRING_INDEX(email, '@', -1), 'yopmail.com'); | |
UPDATE fos_user | |
SET | |
email = REPLACE(email, SUBSTRING_INDEX(email, '@', -1), 'yopmail.com'), | |
email_canonical = REPLACE(email_canonical, SUBSTRING_INDEX(email_canonical, '@', -1), 'yopmail.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment