I have few accounts with same details except different email. Is there any way to figure out their details ? like selecting emails which have same first name & last name using an SQL query ?
1 Answer
It doesn't really scale well, but here you go:
select attribute_id into @firstname from eav_attribute where entity_type_id = 1 and attribute_code = 'firstname';
select attribute_id into @lastname from eav_attribute where entity_type_id = 1 and attribute_code = 'lastname';
select count(email), group_concat(email), cev_fn.value as firstname, cev_ln.value as last name
from customer_entity ce
inner join customer_entity_varchar cev_fn on cev_fn.entity_id = ce.entity_id and cev_fn.attribute_id = @firstname
inner join customer_entity_varchar cev_ln on cev_ln.entity_id = ce.entity_id and cev_ln.attribute_id = @lastname
group by cev_fn.value, cev_ln.value having count(email) > 1