隨筆-144  評(píng)論-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

          版權(quán)聲明:CSDN是本Blog托管服務(wù)提供商。如本文牽涉版權(quán)問(wèn)題,CSDN不承擔(dān)相關(guān)責(zé)任,請(qǐng)版權(quán)擁有者直接與文章作者聯(lián)系解決。



          評(píng)論

          faintbear 發(fā)表于 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 發(fā)表于 2004-12-02 11:39 AM   
          關(guān)于in exists 的區(qū)別

          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 發(fā)表于 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 發(fā)表于 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 小力力力 閱讀(295) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): ORACLE
          主站蜘蛛池模板: 东阿县| 贞丰县| 贺州市| 武清区| 定西市| 渝中区| 涟水县| 兰州市| 肇源县| 庆云县| 长葛市| 岑溪市| 县级市| 保山市| 共和县| 营山县| 新安县| 永安市| 天气| 凉城县| 容城县| 香港| 凤山市| 班玛县| 高安市| 塘沽区| 丰都县| 太谷县| 堆龙德庆县| 宁津县| 科技| 泉州市| 花垣县| 安达市| 大英县| 乃东县| 台南县| 伊宁县| 德惠市| 平遥县| 肇州县|