Joining together consecutive date validity intervals
I have a series of records containing some information (product type) with temporal validity. I would like to meld together adjacent validity intervals, provided that the grouping information (the product type) stays the same. I cannot use a simple GROUP BY with MIN and MAX , because some product types ( A , in the example) can "go away" and "come back". Using Oracle 11g. A similar question for MySQL is: How can I do a contiguous group by in MySQL? Input data : | PRODUCT | START_DATE | END_DATE | |---------|----------------------------------|----------------------------------| | A | July, 01