Subject Re: [ib-support] Temporary Tables in SP
Author Dimitry Sibiryakov
On 7 May 2003 at 13:32, Tim Ledgerwood wrote:

>Which would give me a singleton result that contains all the data from
>the row where BATCH_OPEN = 1 and BATCHNO is the highest batch number
>in the temporary table.

SELECT * FROM BATCH
WHERE BATCHNO=(SELECT MAX(BACHNO) FROM BATCH WHERE BATCH_OPEN=1)

This query will give you exactly the same result as your sequence.
I also think that it can work in Sybase too.

SY, Dimitry Sibiryakov.