I have a table with a series of 4 data points for each country, I have been asked to add each data point as a column so that there is only one row per country. I have researched a little online and I have tried to use the PIVOT function but I have had a few issues with this.
I believe there are too many rows to list the contents and do a union.
Am I going on the right track or is there something easier I should be trying?
My script so far:
"SELECT * FROM
SELECT country_code, un_country_property_id, value
FROM dbo.un_country_property_value) A
(MAX(value) for un_country_property_id IN ([Country Code], [Currency Code],
[Dialling Code], [Market])) AS B"
Error converting data type nvarchar to int.
The incorrect value "Country Code" is supplied in the PIVOT operator.
Thanks for your help in advance!