kymbrik
11/20/2017 - 4:10 PM

Get images and position for a specific sku with direct SQL Magento

SELECT a.sku, b.value, c.position
FROM `catalog_product_entity` AS a
LEFT JOIN `catalog_product_entity_media_gallery` AS b ON a.entity_id = b.entity_id
INNER JOIN `catalog_product_entity_media_gallery_value` AS c ON c.value_id = b.value_id
WHERE a.sku = 98044057168 and c.store_id = 0