Guest User

Untitled

a guest
Dec 16th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. INSERT INTO catalog_product_index_price (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (
  2. SELECT entity_type_id,attribute_id,store_id,entity_id,value FROM (
  3. SELECT 4 as entity_type_id, 456 as attribute_id, 0 as store_id, catalog_product_link.product_id as entity_id, catalog_product_index_price.min_price as value
  4. FROM catalog_product_index_price
  5. JOIN catalog_product_link ON catalog_product_link.linked_product_id = catalog_product_index_price.entity_id
  6. WHERE catalog_product_link.link_type_id IN (
  7. SELECT link_type_id
  8. FROM catalog_product_link_type
  9. WHERE code LIKE 'custom_%'
  10. )
  11. GROUP BY catalog_product_link.product_id
  12. ORDER BY catalog_product_index_price.min_price
  13. ) as from_price_table);
Add Comment
Please, Sign In to add comment