How to transform rows to columns

后端 未结 4 407
Happy的楠姐
Happy的楠姐 2020-12-06 02:54

I have a simple problem when querying the SQL Server 2005 database. I have tables called Customer and Products (1->M). One customer has most 2 products. Instead of output as

4条回答
  •  情书的邮戳
    2020-12-06 03:13

    in sql2005, there are functions called "PIVOT" and "UNPIVOT" which can be used to transform between rows and columns.

    Hope that could help you.

提交回复
热议问题