DECLARE Employee_Cursor CURSOR FOR
SELECT top 20 sal_sales, sales_name,sal_team FROM sal_a_sales where sal_group=16
OPEN Employee_Cursor
FETCH NEXT FROM Employee_Cursor
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM Employee_Cursor
END
CLOSE Employee_Cursor
DEALLOCATE Employee_Cursor
简单游标
DECLARE Employee_Cursor CURSOR FORSELECT top 20 sal_sales, sales_name,sal_team FROM sal_a_sales where sal_group=16OPEN Employee_CursorFETCH NEXT FROM Employee_CursorWHILE @@FETCH_STATUS = 0BEGINFETCH
·
转载于:https://www.cnblogs.com/streetpasser/archive/2012/11/27/2790392.html
更多推荐
所有评论(0)