vf page
apex code
public class duplicationAA {
List<aggregateResult> Duplica {get;set;}
List<Contact> contro {get;set;}
contact c {get;set;}
public List<aggregateResult> getDuplicamethod()
{
contro=new List<Contact>();
Duplica=new List<aggregateResult>();
Duplica=[SELECT Department,Email,LastName,Name,Phone,Title,count(id) FROM Contact
GROUP BY Department,Email,LastName,Name,Phone,Title HAVING count(id)>1];
for(aggregateResult a:Duplica){
Contact c=new Contact(Department=(String)a.get('Department'),
Email=(String)a.get('Email'),
LastName=(String)a.get('LastName'),
Phone=(String)a.get('Phone'),
Title=(String)a.get('Title'));
contro.add(c);
}
return Duplica;
}
}