Actually, this does not apply to SQL, and I doubt that the "conversation template" is the correct name, but I could not come up with a better header.
To simplify, imagine you got a huge stream of ints. The task is to find the pattern A.{1;max_n}A: int satisfies the pattern if n (> 0) other ints follow it, then the original int again, and n <= max_n.
Example:
...
1
4 <--
7 \
3 > n = 3
3 /
4 <--
2
...
Here int is 4repeated with 3 arbitrary ints between them, so for max_n <= 3 the pattern is executed for the value 4.
The question is, how do you determine which integers in a huge data dump follow this pattern? What interests me most is the algorithm itself, but an example in SQL or C # is also welcome.
, , - ints, , .