Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- p.id_product,
- pa.reference,
- pa.upc,
- pa.price,
- pai.id_image,
- pl.name,
- GROUP_CONCAT(DISTINCT(pal.name) SEPARATOR ", ") as combination,
- pq.quantity
- FROM ps_product p
- LEFT JOIN ps_product_attribute pa ON (p.id_product = pa.id_product)
- LEFT JOIN ps_stock_available pq ON (p.id_product = pq.id_product AND pa.id_product_attribute = pq.id_product_attribute)
- LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product)
- LEFT JOIN ps_product_attribute_combination pac ON (pa.id_product_attribute = pac.id_product_attribute)
- LEFT JOIN ps_attribute_lang pal ON (pac.id_attribute = pal.id_attribute)
- LEFT JOIN ps_product_attribute_image pai on(pa.id_product_attribute = pai.id_product_attribute)
- WHERE pl.id_lang = 1
- AND pal.id_lang = 1
- GROUP BY pac.id_product_attribute;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement