从Interbase在SQL中生成行号 [英] Generate row numbers in SQL from Interbase

查看:72
本文介绍了从Interbase在SQL中生成行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Interbase可以吗? 例如,例如链接.

Is this possible from Interbase ? For example like in this link.

推荐答案

您可以使用生成器.创建它

You can use generator. Create it

CREATE GENERATOR g_rowno;

然后像这样使用

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.

在Firebird中,您可以使用EXECUTE BLOCK构造来处理每一行, 在将行号传递到客户端应用程序之前添加行号.

In Firebird you can use EXECUTE BLOCK construction for processing every row and adding row number before passing it to the client application.

这篇关于从Interbase在SQL中生成行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆