Turn Column into "Pivot" row

Asked

Viewed 201 times

2

inserir a descrição da imagem aqui

I’m trying to turn the column "prtnum" branded yellow in Line, I’m trying to use the PIVOT but I’m not succeeding I’ve tried some ways and not right:

Select 

 Distinct (ORD_LINE.ordnum),
 ORD_LINE.prtnum,
 Sum (ORD_LINE.ordqty)

From ORD_LINE


Where 
ORD_LINE.entdte >= trunc (sysdate, 'MM')

Group By ORD_LINE.ordnum,ORD_LINE.prtnum
  • You are using correct Oracle?

  • That’s right, buddy

  • Pivot on Oracle has to report ALL possible occurrences, I do not know if in this case pivot ( Sum (ORD_LINE.ordqty) for state_code in ('7131410','7196660'...) )

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.