Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Magento2 - MySQL Select simples products not assigned to parents
SELECT * FROM `catalog_product_entity`
LEFT JOIN `catalog_product_entity_int` ON `catalog_product_entity`.`entity_id` = `catalog_product_entity_int`.`entity_id`
WHERE `catalog_product_entity`.`type_id` = 'simple' AND `catalog_product_entity_int`.`attribute_id` = (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` = 'visibility') AND `catalog_product_entity_int`.`value` = 1 AND `catalog_product_entity`.`entity_id` NOT IN
(
SELECT `product_id` FROM `catalog_product_super_link`
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment