I need a view to transponate / change a existing simple MySQL Table.
There are ID's in every row with specific Parameters for TF, TP, SL, TR, SO in columns.
ID = Primary key and there are no duplicates.
Now I want to change the structure to have a column for each ID and below all the mentioned parameters in rows
Actual Table Structure:
ID | TF | TP | SL | TR | SO 2034 | H8 | 40 | 20 | 5 | 20 1023 | D1 | 20 | 10 | 5 | 15
How it should look like with view:
ID | 2034 | 1023 TF | H8 | D1 TP | 40 | 20 SL | 20 | 10 TR | 5 | 5 SO | 20 | 15
I tried a lot with union all but I could not solve it. Thank you in advance