Jump to content

Edit History

Chris2022

Chris2022

Thanks for the reply

I would like to get these columns from the query:

1514449172_columnsgoal.thumb.png.4bdccbbd141b31a222cbd401519f7ed1.png

 

So far, I was able to build such a query as a test. There are 15 records instead of one, and the features are 0-1 instead of the text

SELECT pl.id_product, cl.id_category, pl.id_lang, pl.name as product_name, cl.name as category, pf.id_feature = 13, pf.id_feature = 35, pf.id_feature = 2, pf.id_feature = 39, pf.id_feature = 3, m.name as brand, pl.meta_description, p.active
FROM pr_product p
LEFT JOIN pr_product_lang pl ON p.id_product = pl.id_product
LEFT JOIN pr_category_lang cl ON cl.id_category = p.id_category_default and cl.id_lang = pl.id_lang
Left Join pr_lang l on l.id_lang = pl.id_lang
LEFT JOIN pr_manufacturer_lang ml on (l.id_lang = pl.id_lang and l.id_lang = ml.id_lang)
LEFT JOIN pr_manufacturer m on (ml.id_manufacturer = m.id_manufacturer)
LEFT JOIN pr_feature_product pf ON p.id_product = pf.id_product 
LEFT JOIN pr_feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = 4)
LEFT JOIN pr_feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = 4)
LEFT JOIN pr_feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = 4)
INNER JOIN pr_feature_shop feature_shop
ON (feature_shop.id_feature = f.id_feature AND feature_shop.id_shop = 1)
where pl.id_lang = 4 and pf.id_product = 4
order by p.id_product, pl.id_lang

test.thumb.png.2b4cbb75ce3ed300e8d6b04f9a3bb67c.png

 

Thanks for the Update query, will be usefull. However, I have to show the columns in the workbook for approval to the client

 

 

 

Chris2022

Chris2022

Thanks for the reply

I would like to get these columns from the query:

1514449172_columnsgoal.thumb.png.4bdccbbd141b31a222cbd401519f7ed1.png

 

So far, I was able to build such a query as a test. There are 15 records instead of one, and the features are 0-1 instead of the text

SELECT pl.id_product, cl.id_category, pl.id_lang, pl.name as product_name, cl.name as category, pf.id_feature = 13, pf.id_feature = 35, pf.id_feature = 2, pf.id_feature = 39, pf.id_feature = 3, m.name as brand, pl.meta_description, p.active
FROM pr_product p
LEFT JOIN pr_product_lang pl ON p.id_product = pl.id_product
LEFT JOIN pr_category_lang cl ON cl.id_category = p.id_category_default and cl.id_lang = pl.id_lang
Left Join pr_lang l on l.id_lang = pl.id_lang
LEFT JOIN pr_manufacturer_lang ml on (l.id_lang = pl.id_lang and l.id_lang = ml.id_lang)
LEFT JOIN pr_manufacturer m on (ml.id_manufacturer = m.id_manufacturer)
LEFT JOIN pr_feature_product pf ON p.id_product = pf.id_product 
LEFT JOIN pr_feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = 4)
LEFT JOIN pr_feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = 4)
LEFT JOIN pr_feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = 4)
INNER JOIN pr_feature_shop feature_shop
ON (feature_shop.id_feature = f.id_feature AND feature_shop.id_shop = 1)
where pl.id_lang = 4 and pf.id_product = 4
order by p.id_product, pl.id_lang

 

test.thumb.png.2b4cbb75ce3ed300e8d6b04f9a3bb67c.png

Thanks for the Update query, will be usefull. However, I have to show the columns in the workbook for approval to the client

 

 

 

Chris2022

Chris2022

Thanks for the reply

I would like to get these columns from the query:

1514449172_columnsgoal.thumb.png.4bdccbbd141b31a222cbd401519f7ed1.png

 

So far, I was able to build such a query as a test. There are 15 records instead of one, and the features are 0-1 instead of the text

SELECT pl.id_product, cl.id_category, pl.id_lang, pl.name as product_name, cl.name as category, pf.id_feature = 13, pf.id_feature = 35, pf.id_feature = 2, pf.id_feature = 39, pf.id_feature = 3, m.name as brand, pl.meta_description, p.active
FROM pr_product p
LEFT JOIN pr_product_lang pl ON p.id_product = pl.id_product
LEFT JOIN pr_category_lang cl ON cl.id_category = p.id_category_default and cl.id_lang = pl.id_lang
Left Join pr_lang l on l.id_lang = pl.id_lang
LEFT JOIN pr_manufacturer_lang ml on (l.id_lang = pl.id_lang and l.id_lang = ml.id_lang)
LEFT JOIN pr_manufacturer m on (ml.id_manufacturer = m.id_manufacturer)
LEFT JOIN pr_feature_product pf ON p.id_product = pf.id_product 
LEFT JOIN pr_feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = 4)
LEFT JOIN pr_feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = 4)
LEFT JOIN pr_feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = 4)
INNER JOIN pr_feature_shop feature_shop
ON (feature_shop.id_feature = f.id_feature AND feature_shop.id_shop = 1)
where pl.id_lang = 4 and pf.id_product = 4
order by p.id_product, pl.id_lang

238499971_SQLqueryresult.thumb.png.3d1a271773df375e70f756dc9cff5481.png

 

Thanks for the Update query, will be usefull. However, I have to show the columns in the workbook for approval to the client

 

 

 

×
×
  • Create New...