« first day (3480 days earlier)      last day (1381 days later) » 

6:09 AM
Morning
 
Morning all. There was a tricky one posted last night - I had a go but could only get so far! Any takers? I'm off for my walk - weather overcast, but warm enough and it doesn't look like rain! :-) For now!
1
Q: How to get non-overlapping distinct intervals from a PostgreSQL table?

ERJANUsing postgresql 9.6. The table has user sessions and I need distinct non overlapping sessions printed. CREATE TABLE SESSIONS( id serial NOT NULL PRIMARY KEY, ctn INT NOT NULL, day DATE NOT NULL, f_time TIME(0) NOT NULL, l_time TIME(0)...

 
 
2 hours later…
8:28 AM
Interesting question!
Methinks this question should be viewed as a self-join.
Join the rows that have overlapping sessions.
Take the minimum start time and the maximum end time of those joined rows.
Easier said than done, need to have a crack at it!
 
 
5 hours later…
1:26 PM
Reminds me a bit of
4
A: Find maximum number of concurrent logged in distinct users

Paul White 9There are standard solutions available to solve this problem by Itzik Ben-Gan and others. There is a question over the precise meaning of "maximum number of concurrent logged in distinct users". If this means that each user might have multiple concurrent sessions, and you only want to count one p...

 
1:47 PM
@Philᵀᴹ Nah. Back in lockdown. School holidays extended by a week and likely most of the coming term will be "from home."
You know what? I'm just going to go right ahead and add this to the playlist, then cry myself to sleep.
:-)
On the up side, only 496 magic unicorns to go until my Ascension to the Exalted Realm.
 

« first day (3480 days earlier)      last day (1381 days later) »