Code:
select (a.broj + 1)
from tablica a
where not exists
(select 1
from tablica b
where b.broj = (a.broj + 1))
order by 1
select (a.broj + 1)
from tablica a
where not exists
(select 1
from tablica b
where b.broj = (a.broj + 1))
order by 1
Ako je niz npr.
Code:
1, 2, 4, 5, 6
1, 2, 4, 5, 6
rezultat će biti 3. Međutim, ako je niz
Code:
2, 3, 5, 6, 7
2, 3, 5, 6, 7
rezultat će vratiti 4 a ne 1 koji je ustvari prvi broj koji nedostaje u nizu.
Ima li netko rješenje?
Hvala!
F