bulk collect 用法
来源:互联网 发布:360数据恢复软件下载手机 编辑:程序博客网 时间:2024/05/21 00:56
create table emp1_tb1(last_name varchar2(20),first_name varchar2(10),salary number(10))beginfor i in 3000..102999 loop insert into emp1_tb1(last_name,first_name,salary) values('car1'||(i-3000),'wu'||(103000-i),i);end loop;commit;end;select count(distinct last_name) "Distinct Last Name" from emp1_tb1
declareall_rows1 number(10);temp_last_name emp1_tb1.last_name%type;begin all_rows1 := 0; temp_last_name:=' '; --cursor for distinct count for cur in(select last_name from emp1_tb1 order by last_name) loop if cur.last_name!=temp_last_name then all_rows1:=all_rows1 +1; end if; temp_last_name := cur.last_name; end loop; dbms_output.put_line('all_rows1 are'||all_rows1); end;
declareall_rows1 number(10);type last_name_tab is table of emp1_tb1.last_name%type index by binary_integer;last_name_arr last_name_tab;temp_last_name emp1_tb1.last_name%type;begin all_rows1 := 0; temp_last_name := ' '; select last_name bulk collect into last_name_arr from emp1_tb1; for i in 1..last_name_arr.count loop if temp_last_name!=last_name_arr(i) then all_rows1 := all_rows1 + 1; end if; temp_last_name := last_name_arr(i); end loop; dbms_output.put_line('all_rows are '||all_rows1); end ;
- bulk collect 用法
- oracle bulk collect用法
- bulk collect用法小结
- bulk collect用法小结
- oracle中bulk collect用法
- Oracle 之 bulk collect 的用法
- Oracle 之 bulk collect 的用法
- Oracle 之 bulk collect 的用法
- oracle pl/sql(bulk collect用法)
- oracle学习之bulk collect用法
- oracle中bulk collect into用法
- oracle中bulk collect into用法
- oracle中bulk collect into用法
- oracle学习之bulk collect用法
- oracle学习之bulk collect用法
- oracle学习之bulk collect用法
- oracle学习之bulk collect用法
- oracle中bulk collect into用法
- linux 读取文件,输出行值
- 1.6.2. Process Implementation,进程切换时
- [Android开发]android 跨进程通信之Broadcast
- session 内部机制
- 操作Word模板文件.dot 结合具体数据 生成Word文档 .doc
- bulk collect 用法
- vc6.0中如何查找内存泄露
- 数据结构中的排序算法
- LVS大全
- 管理音频缓冲|线程切换Sleep
- 通用的个人所得税计算函数--VFP版
- SQL 获取插入后的最新一条记录ID号
- 二层接口ATM接口和ETH接口
- 东南融通之殇(软件企业思考系列之一)