Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. WITH cte_attributes AS(
  2. SELECT
  3. product_attribute_type.id,
  4. product_attribute_type.product_sku,
  5. product_attribute_type.name,
  6. product_attribute_value.value
  7. FROM product_attribute_type
  8. INNER JOIN product_attribute_value ON product_attribute_value.attr_type = product_attribute_type.id
  9. )
  10. SELECT
  11. product.sku,
  12. product.name,
  13. product_category.name AS category,
  14. cte_attribute.name,
  15. cte_attribute.value,
  16. base_price
  17. FROM product
  18. INNER JOIN cte_attributes ON cte_attributes.product_sku = product.sku
  19. INNER JOIN product_price ON product_price.product_sku = product.sku
  20. INNER JOIN product_category ON product_category.id = product.product_category;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement