Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.63 KB | None | 0 0
  1. select pe.sku, eDate.value as expectedDate, soonRelease.value as soon_release, ss.stock_status, ss.qty as stock_status_qty,
  2. si.qty as stock_item_qty, si.is_in_stock, thuong_mai_dien_tu, hcm.qty as hcm, thuong_mai_dien_tu_ha_noi, hn.qty as hn, tiki
  3. from fhs_catalog_product_entity pe
  4. join fhs_cataloginventory_stock_status ss on ss.product_id = pe.entity_id
  5. join fhs_cataloginventory_stock_item si on pe.entity_id = si.product_id
  6. left join fahasa_bookstore_stock fbs on fbs.mabh = pe.sku
  7. LEFT JOIN fhs_catalog_product_entity_int soonRelease ON pe.entity_id = soonRelease.entity_id AND soonRelease.attribute_id = 155
  8. left join fhs_catalog_product_entity_datetime eDate ON pe.entity_id = eDate.entity_id AND eDate.attribute_id = 191
  9. left join (
  10.     select loc.sku, sum(loc.qty) as qty
  11.     from fhs_bookshelf_product_location loc
  12.     join fhs_bookshelf b on b.entity_id = loc.bookshelf_entity_id
  13.     where b.bookstore_id in (67)
  14.     group by loc.sku
  15. ) as hcm on hcm.sku = pe.sku
  16. left join (
  17.     select loc.sku, sum(loc.qty) as qty
  18.     from fhs_bookshelf_product_location loc
  19.     join fhs_bookshelf b on b.entity_id = loc.bookshelf_entity_id
  20.     where b.bookstore_id in (89)
  21.     group by loc.sku
  22. ) as hn on hn.sku = pe.sku
  23. where pe.sku in ('1901011270675','1901011270712','8935073071591','9786045711422','8938520686065','8935086843727','8935001801856-xanh','8801237806081-hong','8801237806081-xanhtroi','8935001882152-xanhla','8936044394039-xanhla','8935219420030-do','8935219420030-xanhduong','8858121000513-do','8935001823629-hongvangvan','bm-9786045541791','pt-9786045541791','bm-8936062804527','1901011126101-tim','8934986000193-mau4','1507020104057-vang','1507020104057-trang');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement