I have a query that returns a dataset with 2 columns, as shown below:
--------------------------
|spec-number|project |
|-----------|-----------|
|649841 |A |
|649841 |B |
|649841 |D |
|84709 |E |
|84709 |B |
|84709 |C |
|84709 |K |
-------------------------
The number of projects a spec-number could be involved in could potentially be infinite.
What I would like the result to look like is:
-------------------------------------------------
|spec-number|project1|project2|project3|project4|
|-----------|--------|--------|--------|--------|
|649841 |A |B |D | |
|84709 |E |B |C |K |
-------------------------------------------------
I tried pivoting but it just gives me a cross tab of projects by spec-number. Any help would be greatly appreciated!