is there any way to have the schema you see here in the SqlFiddle shown as:
SKU | size S | size M | size L | init_qty | qty
? I was trying to use GROUP_CONCAT by it is no what I am looking for.
Here it is my query
select sku, name, group_concat(taglie separator ';') as `Magazzino`
from
(
select p.sku, p.name, concat(po.valuename, ':',
group_concat(po.value separator ',')) as taglie
from products p
right join products_opt po
on p.id = po.product
group by p.sku
) tbl
group by sku;
Any suggestion? Thank you