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