Get Duplicate Values MySQL

Get Duplicate Values MySQL

Simply group on all required columns.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SELECT
customer_name, customer_email, customer_age, COUNT(*)
FROM
users
GROUP BY
customer_name, customer_email, customer_age
HAVING
COUNT(*) > 1
SELECT customer_name, customer_email, customer_age, COUNT(*) FROM users GROUP BY customer_name, customer_email, customer_age HAVING COUNT(*) > 1
SELECT
    customer_name, customer_email, customer_age, COUNT(*)
FROM
    users
GROUP BY
    customer_name, customer_email, customer_age
HAVING 
    COUNT(*) > 1