Skip to content

Instantly share code, notes, and snippets.

@6ui11em
Created October 3, 2023 17:05
Show Gist options
  • Save 6ui11em/ff1f9ba12ee0c86518856f435f61f4af to your computer and use it in GitHub Desktop.
Save 6ui11em/ff1f9ba12ee0c86518856f435f61f4af to your computer and use it in GitHub Desktop.
Magento 2: Query products without image
SELECT * FROM `catalog_product_entity` WHERE `entity_id` NOT IN (SELECT `entity_id` FROM `catalog_product_entity_media_gallery_value_to_entity`) AND `entity_id` IN (SELECT entity_id FROM `catalog_product_entity_int` WHERE attribute_id = ( SELECT attribute_id FROM `eav_attribute` WHERE `attribute_code` = 'status' ) AND `catalog_product_entity_int`.value = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment