隨筆-144  評論-80  文章-1  trackbacks-0
          select yw_seq,sum(bill),sum(louisa),sum(lynn),sum(wang),com_no  from (select com_no,yw_seq,decode(person,'0001',(agree)) as lynn,decode(person,'0011',(agree)) as bill,decode(person,'0054',(agree))as wang,decode(person,'0005',(agree)) as louisa from ywht_shenpi group by yw_seq,person,agree,com_no) group by yw_seq,com_no

          版權聲明:CSDN是本Blog托管服務提供商。如本文牽涉版權問題,CSDN不承擔相關責任,請版權擁有者直接與文章作者聯系解決。



          評論

          faintbear 發表于 2004-12-02 11:35 AM   
          set serveroutput on;

          declare

          l_count integer;

          begin

          for e in (select emp_no,emp_name from cus_emp_basic) loop

          select count(*) into l_count from cus_emp_basic

          where e.emp_no = emp_no and emp_no = '00006006';

          if l_count != 0 then

          dbms_output.put_line(e.emp_name);

          end if;

          end loop;

          end;


          faintbear 發表于 2004-12-02 11:39 AM   
          關于in exists 的區別

          select emp_name from cus_emp_basic e
          where exists (select 0 from cus_emp_basic where e.emp_no=emp_no and emp_no='00006006');


          faintbear 發表于 2004-12-02 11:54 AM   
          select * from (select rownum r,b.* from cus_emp_basic b where rownum<=3) t where t.r>=1

          faintbear 發表于 2004-12-02 11:55 AM   
          select * from (select rownum r,b.* from cus_emp_basic b where rownum<=3) t where t.r>=1
          posted on 2005-03-30 20:59 小力力力 閱讀(298) 評論(0)  編輯  收藏 所屬分類: ORACLE
          主站蜘蛛池模板: 石楼县| 阳原县| 齐河县| 华池县| 县级市| 长海县| 汉源县| 太白县| 香河县| 通州市| 石门县| 美姑县| 元谋县| 邻水| 大新县| 扶绥县| 菏泽市| 来安县| 建平县| 嘉定区| 中西区| 九寨沟县| 紫金县| 合肥市| 陵水| 上蔡县| 大城县| 阳朔县| 吉林市| 昭觉县| 平遥县| 株洲市| 论坛| 龙州县| 海晏县| 武乡县| 揭西县| 临洮县| 定兴县| 田阳县| 石景山区|