I'm trying to pivot the data in below table to columns.
I have a member table and it contains information like below
For the same member 123 and witth different Id values will provide different information like ID = 456 will provide about test information and ID = 888 will provide date information and the values are in VALUE field
So for the particular member 123 I looking for an output like below with all the information with changing id value and its corresponding values
Note: I'm just using pipe in above example to seperate fields.
To understand the problem completely and to suggest a solution, I guess its important to know how many distinct ID values can possibly be for a MEMBER, and how many distinct possible VALUE can exist for each ID against each member?
Because the number of columns in the pivot result will depend on these values.
If these values are limited then a SQL logic with fixed number of columns will do the job otherwise a recursive SQL or a procedure will be the way to go.