How to write for-loop like code in SQL

I needed to dynamically generate missing items in database. I had a list of Sports and Categories, and I needed to generate items with all combinations of these two entities. But some of them already existed in database, so those should be skipped. My idea was to perform kind of for-each loop iterating over the …

C# – How to find overlap of datetime intervals

I needed to count the overlap of the datetime intervals. After some coding I’ve refactored the code to static class and uploaded to Github, so that others can use it too. It might save you some time 🙂 There are currently two methods. One to get the interval overlap and the other to count the interval …