Detecting “Holes” in a Series
Question:
Consider the following table
While seq is supposed to be a continous series of figures, this is not the case. How to detect the range of “holes” within the data?create table t ( seq int );
For example, assume t contain the following:
t
——-
1
2
6
8
The values indicating 3-5 and 7 should be returned.
The funny part in this question is that you need to return valuesoutside the data. But those data can be derived by the data easily
(閱讀全文)
(0)