游标
因为80号部门有多个人所以要使用游标(处理多条记录)
1.(2)定义一个变量,把数据放到里面
3.把游标放进一个变量里面
4.(1)判断游标还有值
(2)输出一下
(3)再循环一下
把ID也打印出来,、
输出的结果为:
与下面的这条语句的查询结果相同
或者
loop:
方法二