打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
分支机构-数据处理

create or replace noneditionable package body p_stu as

  --游标和结构体,包规范中已声明,包体中不用再声明,直接使用。

  --实现方法

  --实现过程

  procedure GetStuList(cid varchar2) as

    -- r_stu re_stu; --直接使用包规范中的结构

    v_a varchar2(200);

  begin

    /*

    update TEMP_DUIWAITOUZI t set t.b=trim(t.b);

    commit;

    delete  TEMP_DUIWAITOUZI t  

    where t.b is null and t.c is null or t.b like '对外投资%' or   t.b like '序号%';

    commit;

        */

    for i in (select to_number(t.a) num, t.*, t.rowid

                from TEMP_DUIWAITOUZI t

               where length(t.b) < 6

               order by to_number(t.a)) loop

      /*

       --找出前一条记录对应的公司

         select t1.b   from TEMP_DUIWAITOUZI t1 where to_number(t1.a)=

      (select max( to_number(tt.a)) from TEMP_DUIWAITOUZI tt where  to_number(tt.a)<i.num);

       */

      update TEMP_DUIWAITOUZI t2

         set t2.b =

             (select t1.b

                from TEMP_DUIWAITOUZI t1

               where to_number(t1.a) =

                     (select max(to_number(tt.a))

                        from TEMP_DUIWAITOUZI tt

                       where to_number(tt.a) < i.num))

       where to_number(t2.a) = i.num;

      commit;

    end loop;

  end;

end;

select * from TEMP_DUIWAITOUZI t order by t.a;

select t.b, count(1)

  from TEMP_DUIWAITOUZI t

 where exists (select 1 from temp_guanliren g where g.a = t.b and g.l like '%股权%')

 group by t.b

having count(1) = 1;

select t.b, count(1)

  from TEMP_DUIWAITOUZI t

 where exists (select 1 from temp_guanliren g where g.a = t.b and g.l like '%股权%')

 group by t.b

having count(1) = 2

厚募fund-ian整理

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
尚学堂oracle笔记 收藏
SQL分页语句
表的复杂查询 --多表的查询
尚学堂马士兵Oracle教程 笔记
oracle利用解析函数row_number高效分页
ORACLE中用ROWNUM分页并排序的SQL语句
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服