Generate row numbers in SQL from Interbase

蹲街弑〆低调 提交于 2020-01-16 18:07:35

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!