I want a query to count the duplicate values in a column, e.g.,
total records=SELECT COUNT(column_name) FROM table_name;
distinct records=SELECT COUNT(DISTINCT column_name) FROM table_name;
duplicate count=total records-distinct records;
A simplification of the SQL you provided:
SELECT Count(Column) - Count(DISTINCT Column)
FROM yourTable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With