Hi,
i need to show every feature in a distinct column on my CSV file.
I've this query:
SELECT
GROUP_CONCAT(DISTINCT (fl.name), ':', (vl.value) ORDER BY fl.id_feature) AS 'Features-list',
FROM
ps_product p
LEFT JOIN ps_feature_product fp ON (p.id_product = fp.id_product)
LEFT JOIN ps_feature_value_lang vl ON (fp.id_feature_value = vl.id_feature_value)
LEFT JOIN ps_feature_lang fl ON (fp.id_feature = fl.id_feature)
GROUP BY p.id_product ASC");
And I'm trying to use this:
SELECT
if(fl.id_feature='1',vl.value,'NO') AS 'Size',
if(fl.id_feature='2',vl.value,'NO') AS 'Year',
FROM
ps_product p
LEFT JOIN ps_feature_product fp ON (p.id_product = fp.id_product)
LEFT JOIN ps_feature_value_lang vl ON (fp.id_feature_value = vl.id_feature_value)
LEFT JOIN ps_feature_lang fl ON (fp.id_feature = fl.id_feature)
GROUP BY p.id_product ASC");
In my CSV some field are correct and some else not... in some field it's shown the right value, in some else "NO".Where do I wrong?
Any ideas to solve?
Thanks