sql - Duplicate Checks with Multiple Values -
i doing manual duplicate checks on database, , have complicated case.
i need check duplicate rows based on value in column a, have done. however, in specific case, there might multiple records have same value column different value column e.
here original query:
select columna, count(*) totalcount tablea inner join tablea_1 on fid = hid datecreated > '2013-05-08 00:00:00' group columna having count(*) > 1 order count(*) desc i need filter out duplicates columna columne different, or unique. have added psuedocode original query
select columna, count(*) totalcount tablea inner join tablea_1 on fid = hid datecreated > '2013-05-08 00:00:00' , columne not unique group columna having count(*) > 1 order count(*) desc i hope makes sense.
you need group clause on columna column , having clause on distinct columne
select columna, count(*) totalcount tablea inner join tablea_1 on fid = hid datecreated > '2013-05-08 00:00:00' group columna having count(distinct columne) > 1 order count(*) desc
Comments
Post a Comment