Jump to content

SQL query not rendering prices correctly


wimogas

Recommended Posts

I need to render Specific Prices, From Quantity, Attribute name and Product Id.

 

This:

 

"

SELECT sp.id_product, sp.id_specific_price, sp.from_quantity, sp.price, pa.id_product_attribute, pa.reference, pc.id_attribute, al.name
FROM ps2_specific_price sp
LEFT JOIN ps2_product_lang pl ON (sp.id_product = pl.id_product)
LEFT JOIN ps2_product_attribute pa ON (sp.id_product = pa.id_product)
LEFT JOIN ps2_product_attribute_combination pc ON (pa.id_product_attribute = pc.id_product_attribute)
LEFT JOIN ps2_attribute_lang al ON (pc.id_attribute = al.id_attribute)
 
WHERE pl.id_lang = 1
"
 
Renders this (red is not valid, not set values):
 
attributes.jpg
 
Does anyone know why this happens?
 
The duplicates are not Languages.
 
Thanks
 
G
Edited by wimogas (see edit history)
Link to comment
Share on other sites

Solved (thanks prestatent) :

 

"

SELECT a.id_product, 

                  a.id_specific_price, 

                  a.from_quantity, 

                  a.price, 

                  c.id_product_attribute, 

                  c.reference, 

                  d.id_attribute, 

                  e.name

FROM     ps2_specific_price a, ps2_product_lang b, ps2_product_attribute c, ps2_product_attribute_combination d, ps2_attribute_lang e

WHERE b.id_lang = 1

and b.id_product = c.id_product

and c.id_product_attribute = d.id_product_attribute

and d.id_attribute = e.id_attribute

and e.id_lang = 1

and b.id_product = a.id_product

and c.id_product_attribute = a.id_product_attribute

"
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...