Skip to content

Instantly share code, notes, and snippets.

@tegansnyder
Created January 16, 2014 22:05
Show Gist options
  • Save tegansnyder/8464383 to your computer and use it in GitHub Desktop.
Save tegansnyder/8464383 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment