http://www.perlmonks.org?node_id=1016313


in reply to Selective printing of the Duplicates

have tried doing that purely with SQL ?

the having clause filters the duplicates while the use of the inline view filters using column2

select * from ( select column1,count(*) from table group by column1 having (count(*)>1 ) ) a, table b where a.column1 = b.column1 and b.column2='**';