I have a table that lists the various parameters and respective values for each part id. It is formatted as such:
Part ID | Parameter | Value |
---|---|---|
0001 | length | 1 |
0001 | width | 2 |
0001 | height | 3 |
0002 | length | 5.3 |
0002 | width | 6 |
0002 | height | 0.2 |
However, the actual table has a lot more parameters. How can I query this table in such a way to get results in the following form?
Part ID | length | width |
---|---|---|
0001 | 1 | 2 |
0002 | 5.3 | 6 |
I also only want to display some of these parameters, and hide others. I have used multiple JOINS
to join the table to itself multiple times, but this feels clunky and I would have to do this at least 10 times. Is there another way to get the data in this form?