游标的面试题.
对游标不熟悉,帮帮忙.
create table t1(id int identity(1,1),
name varchar(10),score varchar(10),grade int,[order] int)
insert t1(name,score,grade)
select 'aa','11',85
union all select 'bb','22',84
union all select 'cc','11',86
union all select 'dd','22',90
union all select 'ee','11',81
按score分组,以grade排名,来update表t1的order(名次)
要求:
写proc(用cursor来实现)