How can I make “month” columns in Sql?

后端 未结 6 841
轻奢々
轻奢々 2020-12-17 01:44

I\'ve got a set of data that looks something like this (VERY simplified):

productId    Qty   dateOrdered
---------    ---   -----------
       1             


        
6条回答
  •  猫巷女王i
    2020-12-17 02:27

    You can use either a Union of your queries rather than temp tables or use the pivot option.

    Here's a forum discussion on it:

    Sql Server Forums - Show the row-wise data as column-wise

提交回复
热议问题