Skip to content

Gap-and-island for more than time threshold

I have these tables: I want to investigate sessions of a user having time time difference between successive rows greater than 5 minutes, reporting: session and session mode number of sessions with the gap-and-island problem. My attempt: Error: Expected results: Note: dbfiddle. Answer The problem is we have t…

Parsing out inconsistent data to grab specific year

I have a TableA with a column Years. Each row value in this column is formatted as a mix of: and The number of years listed in each row varies (could be 1, could be 10). I have a task to pull the latest year for each row. I am not even sure where to start on this, so I