Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
How best can I find next 4 sets of sequential Id's in a mySQL table?
Post Flair (click to view more posts with a particular flair)
Post Body

I have a table with 1000's of numeric values in a 'checkInDay' column where day is the number of days since 1st Jan 1970.

'checkInDay'
14610
14612
14616
14617
14618
14619
14621
14622
14625

So if my query is looking for 3 nights it would be able to pull out 14616,14617,14618 from the above as these are the first 3 sequential days available but exclude 14619 as this is a 4th night and I am looking for only 3

At the moment I check for availability on a set night using the query below but I'm struggling to refactor this to check for the next set of available dates.

SELECT CASE WHEN (

SELECT count(id) as cnt

FROM availability

WHERE roomType = 'R1'

AND checkInDay IN (18612, 18613, 18614) ) = 3

THEN 'true'

ELSE 'false'

END as allNightsAvailable;

Author
Account Strength
90%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
691
Link Karma
293
Comment Karma
398
Profile updated: 5 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago