Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select pe.sku, prodname.value as name,
- ifnull(price.value, fs.price) as price,
- thumbnail.value as thumbnail
- from fhs_catalog_product_entity pe
- left join fahasa_stock fs on fs.sku = pe.sku
- LEFT JOIN fhs_catalog_product_entity_varchar prodname ON pe.entity_id = prodname.entity_id AND prodname.attribute_id = 71
- left join fhs_catalog_product_entity_decimal price ON pe.entity_id = price.entity_id and price.attribute_id = 75
- LEFT JOIN fhs_catalog_product_entity_varchar thumbnail ON pe.entity_id = thumbnail.entity_id AND thumbnail.attribute_id = 87
- where pe.sku = '8801237812402'
- union
- select sss.special_sku as sku, prodname.value as name,
- price.value as price, thumbnail.value as thumbnail
- from fahasa_special_stock_sku sss
- left join fhs_catalog_product_entity pe on pe.sku = sss.special_sku
- LEFT JOIN fhs_catalog_product_entity_varchar prodname ON pe.entity_id = prodname.entity_id AND prodname.attribute_id = 71
- left join fhs_catalog_product_entity_decimal price ON pe.entity_id = price.entity_id and price.attribute_id = 75
- LEFT JOIN fhs_catalog_product_entity_varchar thumbnail ON pe.entity_id = thumbnail.entity_id AND thumbnail.attribute_id = 87
- where sss.sku = '8801237812402';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement