select * from(
select DeptName,InputCode
from FWD_Department
groupby DeptName,InputCode
) as a
pivot(
max(InputCode) for DeptName in([随访中心],[全院],[家庭化产房],[妇科二],妇科一)
) piv
culuo4781的博客 XQuery in the SQLServer helps to query and extract data from XML documents. XQuery gives different approaches to get information from the XML document and the equivalent can be used on appl...