Jump to content

Recommended Posts

Buenos dias a todos, estoy haciendo una consulta sql en el gestor de sql de prestashop.

Es una consulta de combinaciones donde la consulta me sale bien todo menos el stock que no me lo muestra, esta es la consulta

"

SELECT pat.id_product

    , prd.reference

    , GROUP_CONCAT(DISTINCT(concat(atgl.name, ":", atg.group_type, ":", atg.POSITION)) SEPARATOR ", ")

    , GROUP_CONCAT(DISTINCT(concat(pal.name, ":", atg.POSITION)) SEPARATOR ", ")

    , pat.supplier_reference

    , pat.reference

    , p.id_product

 FROM ps_product_attribute pat

INNER JOIN ps_product prd ON (prd.id_product = pat.id_product)

LEFT JOIN ps_product_attribute_combination pac ON (pat.id_product_attribute = pac.id_product_attribute)

 LEFT JOIN ps_attribute att ON (pac.id_attribute = att.id_attribute)

 LEFT JOIN ps_attribute_group atg ON ( atg.id_attribute_group = att.id_attribute_group)

 LEFT JOIN ps_attribute_group_lang atgl ON ( atgl.id_attribute_group = atg.id_attribute_group)

 LEFT JOIN ps_attribute_lang pal ON (pac.id_attribute = pal.id_attribute AND pal.id_lang = atgl.id_lang)

LEFT JOIN ps_stock_available pq ON ( p.id_product = pat.id_product

AND pat.id_product_attribute = pac.id_product_attribute )

WHERE atgl.id_lang = 1

GROUP BY pat.id_product_attribute

ORDER BY pat.id_product, pac.id_attribute "

 

 

Esto es lo que no me va " 

LEFT JOIN ps_stock_available pq ON ( p.id_product = pat.id_product

AND pat.id_product_attribute = pac.id_product_attribute )"

 

Alguien que me pueda echar una mano.

Gracias.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...