Kommt auch etwas Schlankes in Frage?
mit FINR im unique keyCode:SELECT min(a.penr)+1 from PERP a left outer join PERP b on a.penr = b.penr +1 where b.penr is null
Code:SELECT min(a.penr)+1 from PERP a left outer join PERP b on a.penr = b.penr +1 and a.finr = b.finr where b.penr is null and a.finr = '001'
Bookmarks