I am using SQL Server. I created a query that shows the data as:
accountNumber fundid
--------------------------
1 238492348 1004
2 238492348 1005
3 238492348 1006
4 238492348 1007
5 238492348 1008
6 238492348 1009
7 238492348 1022
8 238492348 1339
I am trying to some how pivot the table in order to make the table look like this instead:
accountNumber adv1 adv2 adv3 adv4 adv5 adv6 adv7 adv8
-----------------------------------------------------------------
1 238492348 1004 1005 1006 1007 1008 1009 1022 1339
Can someone assist me in how I can do this with SQL Server?
Everything I am reading wants me to do like a sum of the numbers or find an aggregate but I am just trying to rotate it and turn it into one row. The most columns it should ever have is up to adv25
.
Any help would be greatly appreciated.