0
My consultation is as follows::
mysql> select product_id, presentation, price from Variant where product_id = "1604";
+------------+-------------------------+-------+
| product_id | presentation | price |
+------------+-------------------------+-------+
| 1604 | Unitário = R$ 11,90 | 11.9 |
| 1604 | 5 Peças = R$ 5,00 cada | 25 |
| 1604 | Bluesky Todas | 15 |
+------------+-------------------------+-------+
3 rows in set (0,00 sec)
How would I separate these 3 results for the same 1604 ID into separate columns in SQL?
Example: presentation1, presentation2, presentation3
column-separated
in the dynamic form returned an error: #1064 - You have a syntax error in your SQL next to ''009- Zener 0,5W from product Where product_id = 1604' in line 1
– J Junior Carneiro
In the static case how would be without putting the names 'Unit = R $ 11,90 ' ?
– J Junior Carneiro
Try running the example from Fiddle. If you have changed the data or have some different character in your table may be influencing the execution.
– Pagotti
About not putting names, only if you have a table whose names have an associated code. In this case you can do a JOIN and use the code related to the description instead of the description.
– Pagotti
could you give me an example ?
– J Junior Carneiro