Subject Re: [firebird-support] Obtaining the minor number that does not exist
Author Ismael L. Donis GarcĂ­a
Perfect, it seems to me that this is the most optimal shape.

Regards
=========
|| ISMAEL ||
=========
----- Original Message -----
From: Ivan Prenosil
To: firebird-support@yahoogroups.com
Sent: Thursday, September 02, 2010 6:28 PM
Subject: Re: [firebird-support] Obtaining the minor number that does not exist

SELECT FIRST 1 ID+1
FROM (SELECT * FROM MyTable WHERE ID BETWEEN 1 AND 1000000 UNION SELECT 0 FROM RDB$DATABASE)
WHERE ID+1 NOT IN (SELECT * FROM MyTable)
ORDER BY ID;

Ivan
http://www.volny.cz/iprenosil/interbase/


[Non-text portions of this message have been removed]