Top "Gaps-and-islands" questions

Gaps and islands problems involve finding a range of missing values (gaps) or a range of consecutive values (islands) in a sequence of numbers or dates.

SQL Query to show gaps between multiple date ranges

Im working on a SSRS / SQL project and trying to write a query to get the gaps between dates and …

sql stored-procedures gaps-and-islands
Resetting Row number according to record data change

I have got the set of data as follow name date x 2014-01-01 x 2014-01-02 y 2014-01-03 …

sql gaps-and-islands
oracle sql query to list all the dates of previous month

Guys i have a requirement to list all the dates of the previous month like below 20101201 20101202 20101203 20101204 20101205 .. .. .. .. .. .. .. .. 20101231 kindly let me know …

sql oracle gaps-and-islands
MySQL: Find Missing Dates Between a Date Range

I need some help with a mysql query. I've got db table that has data from Jan 1, 2011 thru April 30, 2011. There …

mysql date gaps-and-islands
SQL to determine minimum sequential days of access?

The following User History table contains one record for every day a given user has accessed a website (in a 24 …

sql sql-server date gaps-and-islands
How do I group on continuous ranges

I know some basic sql, but this one is beyond me. I have looked high and low but no dice. …

sql sql-server sql-server-2005 tsql gaps-and-islands
Group data by the change of grouping column value in order

With the following data create table #ph (product int, [date] date, price int) insert into #ph select 1, '20120101', 1 insert …

sql sql-server-2008 tsql gaps-and-islands
Iterating through dates in SQL

I have a table of data that looks a bit like this: Name StartTime FinishTime Work Bob 2010-08-03 08:00:00 2010-08…

sql tsql sql-server-2005 gaps-and-islands
How can I identify groups of consecutive dates in SQL?

Im trying to write a function which identifies groups of dates, and measures the size of the group. I've been …

sql date gaps-and-islands
sql query to get deleted records

You have a table table1 that contains id column, that is int(11), not null, auto_increment and starts from 1. Suppose, …

mysql sql select gaps-and-islands