I've googled it a bit, can cant seem to find a solution that doesnt use a temp table or cursor. I need a SQL statement that would return numbers that are missing from a range of numbers.
Say, range 1-10
Table1:
--------
1
2
4
5
6
8
9
10
I'd want my query to return 3 and 7.
I think i might just have to create a non-temporary table and fill it with values 0-1000000 and use a NOT EXISTS clause. (I'll be running this query frequently, hence not using a temp table)
Say, range 1-10
Table1:
--------
1
2
4
5
6
8
9
10
I'd want my query to return 3 and 7.
I think i might just have to create a non-temporary table and fill it with values 0-1000000 and use a NOT EXISTS clause. (I'll be running this query frequently, hence not using a temp table)