troubleshooting Question

SQL Select Query help

Avatar of Philippe Renaud
Philippe RenaudFlag for Canada asked on
Microsoft SQL ServerMicrosoft SQL Server 2008SQL
1 Comment1 Solution152 ViewsLast Modified:
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)

Sr. System Analyst

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros