Advertisement
nicolaslagios

Mosty sql parallages

Jul 15th, 2022
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.80 KB | None | 0 0
  1. SELECT
  2.     p.id_product,
  3.     pa.reference,
  4.     pa.upc,
  5.     pa.price,
  6.     pai.id_image,
  7.     pl.name,
  8.     GROUP_CONCAT(DISTINCT(pal.name) SEPARATOR ", ") as combination,
  9.     pq.quantity
  10. FROM ps_product p
  11. LEFT JOIN ps_product_attribute pa ON (p.id_product = pa.id_product)
  12. LEFT JOIN ps_stock_available pq ON (p.id_product = pq.id_product AND pa.id_product_attribute = pq.id_product_attribute)
  13. LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product)
  14. LEFT JOIN ps_product_attribute_combination pac ON (pa.id_product_attribute = pac.id_product_attribute)
  15. LEFT JOIN ps_attribute_lang pal ON (pac.id_attribute = pal.id_attribute)
  16. LEFT JOIN ps_product_attribute_image pai on(pa.id_product_attribute = pai.id_product_attribute)
  17. WHERE pl.id_lang = 1
  18. AND pal.id_lang = 1
  19. GROUP BY pac.id_product_attribute;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement