How to find duplicates in a table SQL?

To find duplicate values in a table, the following query will works out very well. You would need to have in what column/field are you looking for duplicate values. We filter on that column where a single/same value is repeated more than once.
The following SQL query will do the job for you:

SELECT
column1, COUNT(*)
FROM test.table1
GROUP BY column1
HAVING COUNT(*)>1

One thought on “How to find duplicates in a table SQL?

Leave a Reply

Your email address will not be published. Required fields are marked *