我想用sql查询打开一个结果集,比方说我希望光标 指向我开头的任何位置给出一个行号,所以是 无论如何我可以使用sql函数来做到这一点,所以当 结果集返回时,第一行将是绝对行dertermine由 行号
解决方案xixi写道: 我想用sql查询打开一个结果集,说我想要光标<通过给出一个行号指向我开始的任何位置,所以是无论如何我可以使用sql函数来做到这一点,所以当结果集返回时,第一行将是绝对行dertermine由行号
我不明白你的问题,但你可以使用row_number()函数 为结果集中的每一行添加一个唯一的数字。 - Knut Stolze 信息n整合 IBM德国/耶拿大学
xixi写道: 我想用sql查询打开一个结果集,说我希望光标指向我通过给出行号开始的任何位置,所以是无论如何我还可以使用sql函数来做到这一点,所以当结果集返回,第一行将是绝对行dertermine的行号
我不明白你的问题,但是你可以使用row_number()函数 为结果集中的每一行添加一个唯一的数字。 - Knut Stolze 信息集成 IBM德国/耶拿大学
同时查看可滚动游标 。 干杯 Serge - Serge Rielau DB2 SQL编译器开发 IBM多伦多实验室
i want to use sql query to open a resultset, say i want the cursor point to whatever position i start with by giving a row number , so is there anyway i can use the sql function to do that, so when the resultset return, the first row will be the absolute row dertermine by the row number
解决方案 xixi wrote: i want to use sql query to open a resultset, say i want the cursor point to whatever position i start with by giving a row number , so is there anyway i can use the sql function to do that, so when the resultset return, the first row will be the absolute row dertermine by the row numberI don''t understand your question, but you can use the row_number() function to add a unique number for each row in the result set. -- Knut Stolze Information Integration IBM Germany / University of Jena
xixi wrote: i want to use sql query to open a resultset, say i want the cursor point to whatever position i start with by giving a row number , so is there anyway i can use the sql function to do that, so when the resultset return, the first row will be the absolute row dertermine by the row numberI don''t understand your question, but you can use the row_number() function to add a unique number for each row in the result set. -- Knut Stolze Information Integration IBM Germany / University of Jena
Also look into "scrollable cursors". Cheers Serge -- Serge Rielau DB2 SQL Compiler Development IBM Toronto Lab更多推荐
怎么做行号查询
发布评论