WITH duplicate_data AS( select email,dob,country from customers Group by email dob,country Having count(*)>1) select cus.* from customers c join duplicate_data d on cus.email=d.email and cus.dob=d.dob and cus.country=d.country; try modifying your query like this.