问题
Is this possible from Interbase ? For example like in this link.
回答1:
You can use generator. Create it
CREATE GENERATOR g_rowno;
And then use like this
SELECT GEN_ID(g_rowno, 1), field1, field2, ... FROM your_table
But it will work only if there is no concurrent executions of the same query.
In Firebird you can use EXECUTE BLOCK construction for processing every row and adding row number before passing it to the client application.
来源:https://stackoverflow.com/questions/3405723/generate-row-numbers-in-sql-from-interbase