Sometimes you need to find all products without assigned images in Magento 2, for example to verify that a product import or data migration is complete. The following SQL query returns products without product images:
|
1 2 3 4 5 6 7 8 9 |
SELECT p.entity_id, p.sku, p.type_id FROM catalog_product_entity AS p LEFT JOIN catalog_product_entity_media_gallery_value_to_entity AS mg ON mg.entity_id = p.entity_id WHERE mg.value_id IS NULL ORDER BY p.entity_id; |