您的位置:首页 > 数据库

SQL Server游标举例

2008-09-22 15:26 183 查看
DECLARE authors_cursor SCROLL CURSOR FOR

SELECT au_lname, au_fname FROM authors

ORDER BY au_lname, au_fname

OPEN authors_cursor

-- Fetch the second row in the cursor. --绝对位置

FETCH ABSOLUTE 2 FROM authors_cursor

-- Fetch the row that is three rows after the current row. --相对位置

FETCH RELATIVE 3 FROM authors_cursor

此例子是pubs 里的

将其换入你的数据库就行了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: