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!

sql aggregation

user10647455Mar 1 2010 — edited Mar 3 2010
Hello All,
I have to write a solution for this prob
Sample Data
Rate           PT              Months
2.2             300             60
2.4             350             12
2.5             400             12
2.5             400             12 
2.5            400              12
2.6            450              12
2.7            450              12
I need solution like this
Rate           PT              Months             Yrs
2.2             300             60                   1-5
2.4             350             12                   6
2.5             400             12                   7-10
2.6            450              12                   11
2.7            450              12                   12
NULL         NULL            NULL               NULL
NULL          NULL           NULL               NULL
Logic
If Col and Col2 does not changes over rows then there is merging of rows
I hop this will make sense.

Please help


Thanks a lot!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2010
Added on Mar 1 2010
20 comments
1,607 views