Avatar of Philippe Renaud
Philippe Renaud
Flag for Canada

asked on 

Help with SQL Query

Hello EE, I need help to transform an existing table results that I did, to change a bit the way results are, in another format.

See picture below for the columns.

You see around the middle, I have 3 columns  OH_WH, PK_WH, WIP_WH.
then after I have the QTY for each of them OH..PK..WIP.

I would need that, instead having 3 columns for OH_WH, PK_WH, WIP_WH., to only have 1 called : "WH" and only keep the 3 QTY columns.

so that results of WH would be vertically instead of horizontally.
in other words, if a row was:   06, 35, 35  and QTY were  1, 39, 36

the results would be :

06      1     0      0
35      0     39   36

do you follow what I mean ?


forEE.jpg
Microsoft SQL ServerSQL

Avatar of undefined
Last Comment
Philippe Renaud

8/22/2022 - Mon