Created
November 23, 2012 12:22
-
-
Save sendoa/4135388 to your computer and use it in GitHub Desktop.
Seleccionar registros repetidos en MySQL
This file contains 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
SELECT email, COUNT(email) as total_registros | |
FROM clientes | |
GROUP BY email | |
HAVING COUNT(email)>1 | |
# http://webintenta.com/seleccionar-registros-repetidos-en-mysql.html | |
# Consulta SQL que nos permite seleccionar una serie de registros repetidos de un campo e-mail, nif o cualquiero otro campo que debería ser único en nuestra tabla. En el siguiente ejemplo se ha consultado la tabla "clientes" para seleccionar los correos electrónicos repetidos y la cantidad de veces que aparecen en la tabla. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment