I deleted my old post and reposting since I did not make myself clear what I was looking to do.
I have a 4800 approx. row database in SQL Server. I need to either take that data and in SQL Server perform SQL code to be able to pivot the data. An example of some pivot code is:
SELECT 'AverageCost' AS Cost_Sorted_By_Production_Days,
[0], [1], [2], [3], [4]
FROM
(SELECT DaysToManufacture, StandardCost
FROM Production.Product) AS SourceTable
PIVOT
(
AVG(StandardCost)
FOR DaysToManufacture IN ([0], [1], [2], [3], [4])
) AS PivotTable;
I have attempted to apply this methodology but I have too many rows and not sure quite how to get what I need done. So my option number 2 was to try concatenation in Excel.
I thought I could do an extract of the raw data into Excel and then some sort of concatenation formula to say if Column A is the same concatenate all the other columns associated. So if Column A2 through A3 is identical concatenate anything in B2 through X3. Everything varies. I attached an example of an extract from the database that is the data have and then below is an example of the need. I don't want to have to do an extract and manually do all this. I am sure there is a way just not sure of that way and what the right process or path is to take.
I have a 4800 approx. row database in SQL Server. I need to either take that data and in SQL Server perform SQL code to be able to pivot the data. An example of some pivot code is:
SELECT 'AverageCost' AS Cost_Sorted_By_Production_Days,
[0], [1], [2], [3], [4]
FROM
(SELECT DaysToManufacture, StandardCost
FROM Production.Product) AS SourceTable
PIVOT
(
AVG(StandardCost)
FOR DaysToManufacture IN ([0], [1], [2], [3], [4])
) AS PivotTable;
I have attempted to apply this methodology but I have too many rows and not sure quite how to get what I need done. So my option number 2 was to try concatenation in Excel.
I thought I could do an extract of the raw data into Excel and then some sort of concatenation formula to say if Column A is the same concatenate all the other columns associated. So if Column A2 through A3 is identical concatenate anything in B2 through X3. Everything varies. I attached an example of an extract from the database that is the data have and then below is an example of the need. I don't want to have to do an extract and manually do all this. I am sure there is a way just not sure of that way and what the right process or path is to take.