I have scenario, where i need to convert rows to columns, but we do not have the fixed # of rows for each customer, it depends on how much fields he/she enters the values based on that those rows will be created in the table. Suppose we have 15 fields on the form, and he/she fill only 13 then, only 13 rows will be created for that customer with values and if some customer fill out all 15 fields then i will have 15 rows in the table for that customer.
Could you please help on how i can write query on this varying rows list and how i can write the sql query to convert all rows to columns with single query.
Sample Data: Id EntityId Key Value 1 1 Fname john 2 1 lname smith 3 1 city nyc 4 1 state ny 5 1 degree MBA 6 2 Fname john 7 2 lname smith 8 2 city nyc 9 2 state ny
if you see above data, entityid=1 have 5 records and 2 only 4.
Thanks