something like: with bounties as ([get the start and end datetimes for each bounty]) , counts as(select a.id , count(distinct c.id)cc from bounties a join bounties c on c.start between a.start and a.end or c.end between a.start and a.end or a.start between c.start and c.end group by 1)select max(cc) -- perhaps
That's offhand and certainly untested. But it may work. :-)
@msh210 but what I observed is that when flagging rudeness it gives the post a -1 then by down voting it is -2. Maybe that way it only takes 3 people? Also wonder if the system handles posts from users with 1 differently (would make sense)
@mbloch IIRC: The flag deducts a vote, but you still need six flags; the system handles content from new users differently to some extent, but that doesn't affect how many spam/rude votes it needs.
What I wrote will find the largest number of bounties that ran simultaneously with a given bounty (not including the bounty itself, which was a separate mistake, but the big mistake was): not all of them need have been simultaneous with one another.
Oh, this should work: with bounties as above, counts as(select a.id, 1+count(distinct c.id)cc from bounties a join bounties c on a.start between c.start and c.end) select max(cc)
That should work because the only time the number of simultaneous bounties increased was when a bounty started, so we only need to count how many bounties existed when a bounty started.
It may be doable with window functions, which would avoid the join, which is probably better for a site with lots and lots of bounties (probably only SO), but the above should be fine for MY.
New Yorkers: Anyone want to meet for lunch a week from Sunday (Pesach Sheini), in the UWS? Feel free to contact me offline at isaacemoses.info (you pick the email address).
I know a lot of Yodeyans are in New York, and I'd love to meet Yodeyans in person.