I have an existing table with the following data:
InputName ResolvedName Type InsertDate
Server_1 Cluster_Alias_1 ABC 9/13/2018 7:47:19 PM
Server_2 Cluster_Alias_1 ABC 9/13/2018 7:47:19 PM
Server_3 Cluster_Alias_1 ABC 9/13/2018 7:47:19 PM
Server_4 Cluster_Alias_1 ABC 9/13/2018 7:47:19 PM
Server_5 Cluster_Alias_1 ABC 9/18/2018 1:55:12 PM
Server_6 Cluster_Alias_1 ABC 9/18/2018 1:55:12 PM
Server_7 Cluster_Alias_1 ABC 9/13/2018 7:47:19 PM
Server_8 Cluster_Alias_1 ABC 9/13/2018 7:47:19 PM
Server_9 Cluster_Alias_1 ABC 9/13/2018 7:47:19 PM
Server_10 Cluster_Alias_1 ABC 9/13/2018 7:47:19 PM
And I am trying to use SQL Pivot to have it look like this:
ResolvedName InputName1 InputName2 InputName3 InputName4 InputName5 InputName6 InputName7 InputName8 InputName9 InputName10
Cluster_Alias_1 Server_1 Server_2 Server_3 Server_4 Server_5 Server_6 Server_7 Server_8 Server_9 Server_10
I have looked at multiple solutions and everything involves pivoting on a number, but everything is referring to a number instead of a string.
Links I have tried:
https://www.sqlshack.com/multiple-options-to-transposing-rows-into-columns/