Search results for "gaps and islands"

Your search for "gaps and islands" returned 100 results:

Technical Article

Advanced grouping for gaps and islands

  • Topic

Hi, I'm trying to figure out how to group a set of data based on how many days a person is sick. The problem is a gaps and island issue combined with running streak, with a twist. The records are either of type Work or Sick and are only saved on it's registered date. So […]

You rated this post out of 5. Change rating

2023-02-20

208 reads

Technical Article

Gaps and Islands with multiple simultaneous insurance coverage?

  • Topic

Most examples of "gaps and islands" queries I've seen focus on an identity column or when tracking a change in a status flag (similar to win/loss streaks for a sports team). I've run into a situation that is a bit more complex than mentioned above. I'm working with healthcare data where a person could have […]

You rated this post out of 5. Change rating

2011-05-26

97 reads

Technical Article

Counting the number of unique days between ranges of dates

  • Topic

This feels like an easy problem to solve, but I have not yet been able to find a solution. I have a table containing an IdentityID, UnitID, StartDate and EndDate.  A person can be a member of more than 1 unit at a time. A person could also not be a member of any unit […]

You rated this post out of 5. Change rating

2021-02-02

1,726 reads

Blog Post

Dipping into the Cookie Jar

  • Blog Post

This post is a response to this month's T-SQL Tuesday #112 prompt by Shane O'Neill.  T-SQL Tuesday is a way for the SQL Server community to share ideas about different database and...

2019-03-12

Technical Article

merge/flatten overlapping Time ranges. In order.

  • Topic

Hi, I have few intervals with status. They change in Time (order indicated by OrderId). In the End I would Like to have flattened (in order of appearance, next OrderId has priority) result like this : as you can see: 1) OrderId=1 was split into 2 rows, as it was partially overlapped by next ranges […]

You rated this post out of 5. Change rating

2015-02-10

2,884 reads

Blogs

How Redgate Flyway Can Boost Your DevOps Journey

By

A brief introduction to the tool and its advantages for database migrations DevOps is...

Building a Docker image with Docker Build Cloud

By

In a previous blog post we went through how to build a Docker container...

Top 8 Courses to Learn SQL for Data Science in 2024 & Beyond

By

Businesses are drowning in data, but starving for insights. That's where SQL experts swoop...

Read the latest Blogs

Forums

How to compare data in customer table with other customers to find related cust

By Zond Sita

select Custno, Addr1, City, Res_Phone, Bus_Phone, Fax_Phone, Marine_Phone, Pager_Phone, Other_Phone, email1, email2 from customer...

process records in loop

By Bruin

I'm only processing 50,000 records not everything from the Table where there are 250,00...

The Marked Transaction

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Marked Transaction

Visit the forum

Question of the Day

The Marked Transaction

I want to mark a transaction in the log as a recovery point. How do I do this in my code if I use the transaction, myTran?

See possible answers