PL/SQL (MOSC)

MOSC Banner

Dynamic pivot

in PL/SQL (MOSC) 4 commentsAnswered

I am trying to use pivot in dynamic fashion .

I have data in


and I want to get result in this format


I have achieved this result by

select * from ( (select users, products, sale from sales))

pivot(   

sum(sale)   for products IN ('product 1', 'product 2', 'product 3', 'product 4', 'product 5')

)


The product range may increase rapidly in future, so I want dynamic pivoting in 'IN' clause.

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center