Find unused eav attribute options in Magento 2
select eaov.value option_value from eav_attribute_option eao
join eav_attribute_option_value eaov on eaov.option_id = eao.option_id
left join catalog_product_entity_int cpei on cpei.value = eao.option_id
where eao.attribute_id = (select ea.attribute_id from eav_attribute ea where ea.attribute_code = 'color')
and cpei.entity_id is null
group by eao.option_id;
Written by sivaschenko
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Magento 2
Authors
sivaschenko
19.23K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#