[thelist] Iterate through result set - Is this possible? (SQL)

Burhan Khalid thelist at meidomus.com
Tue May 31 08:46:55 CDT 2005

Joshua Olson wrote:
>>-----Original Message-----
>>From: Ken Schaefer
>>Sent: Tuesday, May 31, 2005 6:43 AM
>>You can't "select" a 7 day gap. You can only select existing data. 
> Ken,
> Perhaps in a manner of speaking you can select a "7 day gap".  Back around
> April, there was a suggestion to Burhan's previous question about this same
> project (presumably) that may be able to help here.  The suggestion was to
> enumerate all possible days (within reason, of course) and join the events
> against that table.  Using an OUTER join, it would be possible to return
> only those days that have no events, thusly returning the "gap".  Analysis
> of this data (which can be done with one query) would allow you to locate a
> range where a day, plus the 6 following days, are all within the results
> set.


   You gave me an idea of approaching the problem from a different 
angle.  Instead of trying to find the gap, how about if I try to find 
all dates that aren't taken. If there are 7 contiguous dates per hall 
(that are > than now()) then that would be a possible hit.

   The problem now has become that I have been staring at the issue for 
two days now, and I don't even know if THAT will work.  Can anyone give 
me a sanity check on that?

More information about the thelist mailing list