steffen-wirth
8/31/2016 - 6:32 AM

find categories with wrong parent levels

find categories with wrong parent levels

select c.entity_id cid, p.entity_id pid
from 
  catalog_category_entity c
  inner join catalog_category_entity p on c.parent_id = p.entity_id
where c.level != p.level+1