use student_data
select *from S
select *from C
select *from SC
--使用游标查询s表中男生信息
declare youbiao scroll cursor--定义
for select* from S
where sgender='男'
--释放游标
--deallocate youbiao
open youbiao--打开游标
fetch last from youbiao--读取最后一行
fetch first from youbiao--读取第一行
fetch absolute 5 from youbiao--读取第五行
fetch relative 3/*后三行-3*/from youbiao--读取当前记录位置前后三行
CLOSE YOUBIAO
deallocate youbiao
declare CS_CURSOR scroll cursor--定义
for select sno,sname,sgender from S
where college='计算机系'
open CS_CURSOR
fetch absolute 2 from CS_CURSOR--读取第2行
update S
set sname='123456',sgender='女'
where current of CS_CURSOR
CLOSE CS_CURSOR
deallocate CS_CURSOR
07-17
905
02-24
3782
05-18
05-18
02-23
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交