So I have a table that looks like this:
LocationID, License, Rank
Each location can have multiple licenses and they're ordered by rank.
My goal is to make a query that lists them like this:
LocationID, License1 (Rank 1), License 2 (Rank 2), License 3 (Rank 3)
but I am not sure how to query like this.
I have attempted to make like 15 views that store the values by rank however when joining on these views, the execution time rises like crazy.
Any advice would be great!
EDIT: So I have pivoted based on the comments, and I have a result set that looks like this:
Location ID:
1, value1, NULL, NULL.
1, NULL, value2, NULL,
1, NULL, NULL, value3
I want to query like this.
LocationID, Value1, Value2, Value3.