SQL query that sums the number of duplicates
Posted on 2014-09-25
I want to return the number of duplicate records per institution. My query looks something like the snippet below. I'm getting an error message that there is a missing right parenthesis, even though the number of left and right parentheses are equal. Even if the parenthesis issue is resolved, I'm not sure that query below will give me the results I want.
SELECT year, institution, SUM(COUNT(student_ID) > 1) AS duplicate_record_count
GROUP BY year, institution
HAVING COUNT(student_ID) > 1