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!

Query with overlapping time periods

2903222Sep 26 2017 — edited Sep 28 2017

Sorry for the imprecise title, but I'm not sure how to describe my issue concisely.

I have a relation table which links "modules" to any combination of three different types of "multipliers".  Each row in the table includes a start and end date for the relation, and each type of multipler can be changed independently of the others.  If I select out a single module-ID, the result might look something like this:

ModuleIDMultiplierTypeStartDateEndDateMultiplierValue
254A19.01.2016null5
254B20.02.201530.03.2016200
254B30.03.2016null100
254C15.09.2014null7

I want to write a query that will take these rows and output a table with the total multiplier for each time period. I.E.:

StartDateEndDateTotalMultiplier
15.09.201420.02.20157
20.02.201519.01.20161400
19.01.201630.03.20167000
30.03.2016null3500

Can someone suggest how to tackle this problem?

Database version: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0

This post has been answered by 2903222 on Sep 26 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 26 2017
Added on Sep 26 2017
26 comments
2,651 views