The following is the query to find the duplicate records in SQL:
SELECT col_1, col_2,…….
COUNT (col)
FROM table_name
GROUP BY col_1, col_2,……
HAVING COUNT(*) > 1;
First, Group by clause groups the records by values of the col_1, col_2,… and after that Count() returns the number of occurrences of each group. Later, Having clause filters the duplicate groups that have the count more than 1.
If you want to learn writing SQL queries, I recommend this SQL tutorial blog by Intellipaat.