Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.19 KB | None | 0 0
  1. select pe.sku, prodname.value as name,
  2. ifnull(price.value, fs.price) as price,
  3. thumbnail.value as thumbnail
  4. from fhs_catalog_product_entity pe
  5. left join fahasa_stock fs on fs.sku = pe.sku
  6. LEFT JOIN fhs_catalog_product_entity_varchar prodname ON pe.entity_id = prodname.entity_id AND prodname.attribute_id = 71
  7. left join fhs_catalog_product_entity_decimal price ON pe.entity_id = price.entity_id and price.attribute_id = 75
  8. LEFT JOIN fhs_catalog_product_entity_varchar thumbnail ON pe.entity_id = thumbnail.entity_id AND thumbnail.attribute_id = 87
  9. where pe.sku = '8801237812402'
  10.  
  11. union
  12.  
  13. select sss.special_sku as sku, prodname.value as name,
  14. price.value as price, thumbnail.value as thumbnail
  15. from fahasa_special_stock_sku sss
  16. left join fhs_catalog_product_entity pe on pe.sku = sss.special_sku
  17. LEFT JOIN fhs_catalog_product_entity_varchar prodname ON pe.entity_id = prodname.entity_id AND prodname.attribute_id = 71
  18. left join fhs_catalog_product_entity_decimal price ON pe.entity_id = price.entity_id and price.attribute_id = 75
  19. LEFT JOIN fhs_catalog_product_entity_varchar thumbnail ON pe.entity_id = thumbnail.entity_id AND thumbnail.attribute_id = 87
  20. where sss.sku = '8801237812402';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement