Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to transpose data values in rows- to columns

907388Apr 2 2013 — edited Apr 2 2013
Hi All,

How do we transpose data values in rows to columns using Oracle sql?

The data in tiers going down needs to be transposed into columns...

The challenge is that the number of tiers changes by account and cannot be predicated.

Given this data with tiers going down:

Account Number Assignment Level Prod Spread (basis points) Pricing Ccy Methodology Tier from Tier to
36898012 Account level Rebate001 100 USD Pool Pricing 0 99
1313211231 Account level Rebate002 100 USD Pool Pricing 0 99
1313211231 Account level Rebate003 100 USD Managed 99 200
14135154 Customer level Rebate004 100 USD Pool Pricing 0 99
14135154 Customer level Rebate005 100 USD Managed 0 99
452542 Customer level Rebate006 100 USD Pool Pricing 0 99



TIER GOING ACROSS with EACH TIER AS COL:


Account Number Assignment Level Prod Spread (basis points) Pricing Ccy Methodology 1 Tier from 1 Tier to 1 Methodology 2 Tier from 2 Tier to 2
24898012 Account level Rebate001 100 USD Pool Pricing 0 99
1313211231 Account level Rebate002 100 USD Pool Pricing 0 99
1313211231 Account level Rebate003 100 USD Managed 99 200
14135154 Customer level Rebate004 100 USD Pool Pricing 99
14135154 Customer level Rebate005 100 USD 99 Managed
452542 Customer level Rebate006 100 USD Pool Pricing 99


DO WE USE ORACLE ANALYTICAL FUNCTIONS?

IS THERE A BETTER WAY AS THAT CAUSES PERFORMANCE ISSUES?
Thanks again
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2013
Added on Apr 2 2013
2 comments
635 views