I have a table in Oracle which is like this, and I don’t know how many ‘Vendor’ is there, this keeps on growing ( but will grow around 50). Basically same products from different Vendors are sourced. The same Product is identified by the same ‘Alias’.
Alias | Product_ID | Vendor |
---|---|---|
123 | abc001 | V1 |
123 | abc002 | V2 |
123 | abc003 | V3 |
456 | abc004 | V1 |
456 | abc005 | V2 |
456 | abc006 | V3 |
I want to represent the data like this:
Alias | V1 | V2 | V3 |
---|---|---|---|
123 | abc001 | abc002 | abc003 |
456 | abc004 | abac005 | abc006 |
Please note that I don’t know how many vendors will get added tomorrow, so my query should work in such a way that it gives an additional column with the same query if a new vendor is added tomorrow.
I need to try this out in Oracle.
Any help is greatly appreciated.