We help IT Professionals succeed at work.
Get Started

SQL Select Query help

Last Modified: 2021-04-21
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)

Watch Question
Sr. System Analyst
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE