oracle游标处理多行记录
来源:互联网 发布:python %s 编辑:程序博客网 时间:2024/05/19 11:38
1.查询工资大于10号部门平均工资的职工信息
declare
cursor cc is select * from emp where sal>(select avg(sal) from emp where deptno=10);
ccrec cc%rowtype;
begin
open cc;
loop
fetch cc into ccrec;
exit when cc%notfound;
dbms_output.put_line(ccrec.empno||'--'||ccrec.ename||'--'||ccrec.job||'--'||ccrec.sal);
end loop;
close cc;
end;
2.查询各个部门的人数
declare
cursor cc is select b.dname,count(a.empno) as zongshu from emp a,dept b where a.deptno=b.deptno group by b.dname;
ccrec cc%rowtype;
begin
open cc;
loop
fetch cc into ccrec;
exit when cc%notfound;
dbms_output.put_line(ccrec.dname||'----'||ccrec.zongshu);
end loop;
close cc;
end;
declare
cursor cc is select * from emp where sal>(select avg(sal) from emp where deptno=10);
ccrec cc%rowtype;
begin
open cc;
loop
fetch cc into ccrec;
exit when cc%notfound;
dbms_output.put_line(ccrec.empno||'--'||ccrec.ename||'--'||ccrec.job||'--'||ccrec.sal);
end loop;
close cc;
end;
2.查询各个部门的人数
declare
cursor cc is select b.dname,count(a.empno) as zongshu from emp a,dept b where a.deptno=b.deptno group by b.dname;
ccrec cc%rowtype;
begin
open cc;
loop
fetch cc into ccrec;
exit when cc%notfound;
dbms_output.put_line(ccrec.dname||'----'||ccrec.zongshu);
end loop;
close cc;
end;
- oracle游标处理多行记录
- ORACLE游标处理大全
- oracle 游标处理过程
- Oracle游标-提取记录、游标循环
- Oracle 游标记录使用示例
- Oracle--游标和异常处理
- ORACLE隐式游标获取记录数
- Oracle 游标处理II - 使用BULK COLLECT
- oracle存储过程+游标处理select数据
- oracle中rownum 与游标的处理
- Oracle 游标 隐式游标,显示游标,游标循环,动态SELECT语句和动态游标,异常处理,自定义异常
- ORACLE重复记录处理
- 使用函数返回一个多行记录(函数+游标)
- oracle 隐式 游标 显示 循环 动态 select 语句 游标 异常 处理 自定义 游标的概念
- oracle 隐式游标,显示游标,游标循环,动态SELECT语句和动态游标,异常处理,自定义异常,
- oracle 隐式游标,显示游标,游标循环,动态SELECT语句和动态游标,异常处理,自定义异常,
- oracle 隐式游标,显示游标,游标循环,动态SELECT语句和动态游标,异常处理,自定义异常
- oracle 隐式游标,显示游标,游标循环,动态SELECT语句和动态游标,异常处理,自定义异常,
- java与模式之策略模式
- BH修改大师 V1.43【mfxp.com】
- 粉碎硬件复杂论:开发者不懂硬件运行的方式怎么可以?!
- MPI_allreduce如何指定输入缓冲与输出缓冲相同
- Vuforia SDK---- Unity3D vuforia SDK 预制物体各组件功能说明
- oracle游标处理多行记录
- s5pv210开发板 sin210 linux 例程 LED 驱动
- 复杂的存储过程例子
- A FLASH Bootloader for PIC16 and PIC18 Devices--硬译(一)
- 黑马程序员 C#基础_骑士飞行棋
- Linux内核-文件系统之/proc目录
- 【图论06】最小生成树 1001 Constructing Roads
- The connection to adb is down, and a severe error has occured.错误
- 绿色高速看图器V1.9官方版——绿色软件下么