How to find the missing numbers in a series?
To demonstrate this, we will first create a test data number sequence from 1 to 25 with some missing numbers in the sequence.
Solution:
The first step is to generate all the numbers from the lowest number till the highest number given in the series. There are several ways to generate the sequence numbers. We will use the recursive CTE to generate the number sequence for this example. Then find the missing number in the sequence by doing an except
.
Output: