1
我试图转换成列,我不断遇到错误。我不知道我做错了什么。我尝试了下面的代码,但我不断得到“FOR”和括号中的第一个单词下的红色波浪线。这里是我的代码:将列转换成行,反之亦然
select d.City,d.Geographic_Region_Name, d.Site_Type
from Site_Profile as d
pivot
(City for Geographic_Region_Name in (City,Geographic_Region_Name,site_type) as pivotable;
不知道更多关于你的数据是什么样的以及你想要实现什么,我不能确定你应该使用哪个函数。 – pcdev
另请参阅[此问题](https://stackoverflow.com/questions/15931607/convert-rows-to-columns-using-pivot-in-sql-server) – pcdev
非常感谢您的回复,pcdev。非常感激 – user2089542