随笔-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 小力力力 阅读(270) 评论(0)  编辑  收藏 所属分类: ORACLE

只有注册用户登录后才能发表评论。


网站导航: