How to construct distinct date ranges from a set of ranges in sql
I have a table with a boolean field I care about, along with the date ranges those fields are relevant. These date ranges can be overlapping, can be entirely interior to other date ranges, and can have gaps.