I have a calendar table that looks like this:
date | qty
-------------------
1998-11-18 | 2
1998-11-19 | 0
1998-11-20 | 0
1998-11-21 | 0
1998-11-22 | 3
1998-11-23 | 0
1998-11-24 | 0
1998-11-25 | 3
I am trying to generate a report which would give the ranges of the entries with the 0 values for quantity (qty). I can't hard code the dates, they need to be determined by the value of the second column. From the above, the report should look like this:
1998-11-19 - 1998-11-21
1998-11-23 - 1998-11-24
All the GROUP BY and UNION queries give me the individual entries but I can't figure out how to create the date ranges.