Jump to content

Export csv from Specific Prices Database


wimogas

Recommended Posts

Hello!

 

Ok, I've got this on my SQL Manager:

 

"
SELECT p.id_specific_price, p.id_product, p.price, p.from_quantity
FROM ps2_specific_price p
"
 
But now I also want to add
 
Name of the Product from my ps2_product_lang 
Name of Attribute from ps2_attribute_lang
 
I know it's very simple but could anyone give me the exact query to get info from various databases at the same time?
 
Thanks!
Edited by wimogas (see edit history)
Link to comment
Share on other sites

OK, so far I've got:

 

"

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_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)

"

 

It somehow works, but if I have 4 attributes and each attribute has 1 specific price, in the csv there are 4 prices for each attribute... makes no sense...

 

img.png

Edited by wimogas (see edit history)
Link to comment
Share on other sites

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_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)
"
 
Renders this (red is not valid, not set values):
 
attributes.jpg
 
Can anyone help? this is driving me nuts
 
THanks 
 
G
 
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...