I have a dynamic attributes table in mysql
attributes
----------
attribute_id description
1 Code produit
2 Code millesime
3 Titre du produit
... ....
And a products table:
products
--------
product_id attribute_id value
1020 1 xyz
1020 2 zyt
1020 3 UUU
.... ... ....
I need an sql statement to pivot the products table so that I get the following:
products_pivot
--------------
product_id Code produit Code millesime Titre du produit ...
1020 xyz zyt UUU ...
Is there a simple way to achieve this in mysql, given that the number of columns generated would be dynamic?
And if so, I was also wondering what the performance would be for let's say 1000 products, each product containing about 100 attributes. (That means 100000 records in the products table...)