The approach is to have a nested query that has one line per duplicate, and an outer query returning just the count of the results of the inner query.
SELECT count(*) AS duplicate_count
FROM (
SELECT name FROM tbl
GROUP BY name HAVING COUNT(name) > 1
) AS t
More Related Contents:
- Remove duplicate rows in MySQL
- Delete all Duplicate Rows except for One in MySQL? [duplicate]
- Find duplicate records in MySQL
- How to delete duplicates on a MySQL table?
- How to abort INSERT operation in MySql trigger?
- Prevent auto increment on MySQL duplicate insert
- Deleting duplicate rows from a table
- In MySQL, can I copy one row to insert into the same table?
- Removing duplicates with unique index
- How to delete duplicate rows from a MySQL table
- How do I delete all the duplicate records in a MySQL table without temp tables
- MySQL delete duplicate records but keep latest
- How to remove duplicate entries from a mysql db?
- How to do unique constraint works with NULL value in MySQL
- Force MySQL to return duplicates from WHERE IN clause without using JOIN/UNION?
- How to store Emoji Character in MySQL Database
- Any way to select without causing locking in MySQL?
- Log all queries in mysql
- Truncate all tables in a MySQL database in one command?
- Cast from VARCHAR to INT – MySQL
- Find distance between two points using latitude and longitude in mysql
- How to convert result table to JSON array in MySQL
- Adding multiple columns AFTER a specific column in MySQL
- Can a MySQL trigger simulate a CHECK constraint? [duplicate]
- MYSQL_ROOT_PASSWORD is set but getting “Access denied for user ‘root’@’localhost’ (using password: YES)” in docker container
- Terminating idle mysql connections
- How to update JSON data type column in MySQL 5.7.10?
- mysql error: Table “mysql”.”innodb_table_stats” not found
- How can I decrypt MySQL passwords
- mySQL query to search all tables within a database for a string?