Jump to content

Astuce: Requete Sql Import /export Caracteristiques Produits


Recommended Posts

Bonjour tout le monde,

 

Voila j'ai galéré a faire ca donc je publie pour ceux qui en ont besoin et en cas d'explosion de mon ordinateur.

SELECT 
fp.`id_product` AS `ID_product`,
pl.`name` AS `Nom`,
GROUP_CONCAT(DISTINCT(concat(fl.`name`,':',fvl.`value`)) SEPARATOR ",") AS `Features`


FROM ps_feature_product fp
LEFT JOIN ps_feature_lang fl ON (fl.`id_feature` = fp.`id_feature`)
LEFT JOIN ps_feature_value_lang fvl ON (fvl.`id_feature_value` = fp.`id_feature_value`)
LEFT JOIN `ps_product_lang` pl ON (fp.`id_product` = pl.`id_product`) 
WHERE 1 AND fvl.`id_lang` = 1
GROUP BY fp.`id_product` 
ORDER BY fp.`id_product` ASC

Edited by Alexandre-KM (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 5 months later...
  • 5 years later...
On 11/30/2015 at 6:22 PM, Alexandre Carette said:

Bonjour tout le monde,

 

Voila j'ai galéré a faire ca donc je publie pour ceux qui en ont besoin et en cas d'explosion de mon ordinateur.

SELECT 
fp.`id_product` AS `ID_product`,
pl.`name` AS `Nom`,
GROUP_CONCAT(DISTINCT(concat(fl.`name`,':',fvl.`value`)) SEPARATOR ",") AS `Features`


FROM ps_feature_product fp
LEFT JOIN ps_feature_lang fl ON (fl.`id_feature` = fp.`id_feature`)
LEFT JOIN ps_feature_value_lang fvl ON (fvl.`id_feature_value` = fp.`id_feature_value`)
LEFT JOIN `ps_product_lang` pl ON (fp.`id_product` = pl.`id_product`) 
WHERE 1 AND fvl.`id_lang` = 1
GROUP BY fp.`id_product` 
ORDER BY fp.`id_product` ASC

Thak you very much.

  • Like 1
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...