This is pure SQL and should work for all cases:

```
WITH M AS (
SELECT Max(SEQUENCE) s
FROM table1
WHERE id = 1
)
,numbers(n) AS
(
SELECT 1 AS n
UNION ALL
SELECT n + 1
FROM Numbers,m
WHERE n + 1 <= s
)
SELECT n
FROM numbers
WHERE n NOT IN (SELECT SEQUENCE FROM table1 WHERE id = 1)
```

I want to get the missing Sequence ie 2,5,7,9. That's all.