SQL Select

{{{Executed SQL}}{{Executed SQL}}{{Executed SQL}}{{Mage_Core}}}
SELECT `main`.`value_id`, `main`.`value` AS `file`, `main`.`entity_id` AS `product_id`, `value`.`label`, `value`.`position`, `value`.`disabled`, `default_value`.`label` AS `label_default`, `default_value`.`position` AS `position_default`, `default_value`.`disabled` AS `disabled_default` FROM `catalog_product_entity_media_gallery` AS `main` LEFT JOIN `catalog_product_entity_media_gallery_value` AS `value` ON main.value_id = value.value_id AND value.store_id = 1 LEFT JOIN `catalog_product_entity_media_gallery_value` AS `default_value` ON main.value_id = default_value.value_id AND default_value.store_id = 0 WHERE (main.attribute_id = '88') AND (main.entity_id in ('425')) ORDER BY IF(value.position IS NULL, default_value.position, value.position) ASC
value_id file product_id label position disabled label_default position_default disabled_default
903 /E/L/EL-14-F302.jpg 425 QIANLONG • CABINET ON STAND 1 0