
There are many scenarios where we may in need to identify the missing numbers in the provided range.
Here is the quick query which help in identifying using CTE [Common Table Expression]:
DECLARE @Test TABLE
(
Num INT
)
INSERT INTO @Test VALUES (1)
INSERT INTO @Test VALUES (2)
INSERT INTO @Test VALUES (4)
INSERT INTO @Test VALUES...