Avatar of Philippe Renaud
Philippe Renaud
Flag for Canada

asked on 

SQL Select Query help

Hello EE,

if you look the embed picture, here is my actual select results.

What I would like to accomplish is, you see Row #2 ? it has Shipped 2 and Amount 4  for the same Style1/2/Year/Month ?

I would like it as a new Row and that "4" would be under the column "Shipped"  and Year (its a string by the way) would be "P"  and month would not change...

at the end it would like like this for 2017 april :

(by the way sorry I repeated the column "Shipped" twice, its a mistake... should be there just 1 time)

.....
682100     792     792 - CROFT   2     2017     April    2
682100     792     792 - CROFT   2        P        April     4
......

so everytime there is a value in amount... I would like it as a new row (a kind of union all) i dont know how to reach that with a query

any help (with source example)


ssss.png
Microsoft SQL ServerMicrosoft SQL Server 2008SQL

Avatar of undefined
Last Comment
HainKurt

8/22/2022 - Mon