Okay, I am a little dense, I was going to ask for an explanation, in very simple terms, then I figured it out. Basically it is subtracting (or adding if your list is descending) the row number from an ordered list of numbers (or dates) to find consecutive ranges of numbers (or dates). Pretty slick.

Hats off. A clear and concise treatment of a non elementary group of problems. I like the pilgrim interpretation. Never thought about using it when I was asked to explain a solution of this kind. Tabibitosan - a word to remember.

First of all, thanks a lot for this great thread. It is in my top bookmarks.
In above example, you have showed how this technique can be applied to group the rows with difference of a month.
I was wondering if this technique can be applied to group rows within a specific interval.
For e.g. is it possible to group the rows in the following resultset, within interval of 1 minute?

Aketi,
Many Thanks.
My sincere apologies as I realised that my description of the problem and test data (in earlier post) were not consistent with each other.
Please allow me to rephrase my question.
With the following data, I would like to group the records within one minute interval and get the first record within the group.
Here is the test case