今天一个回复都发不出去,CSDN怎么了?
访问其他的网站都挺好的,就是访问CSDN特别慢,写了很多东西一次都没发成功,到底怎么了?
你们有这个问题吗?
http://www.csdn.net/expert/topic/885/885980.xml?temp=.4481928
主 题: 在PL/SQL设计中遇到的问题,建立存储过程出错?
作 者: chuanying ()
[我的回复]
open c1;
fetch c1 into v_newdate;
if c1%notfound then
v_wxsys:=0
end if
v_currentdate:=v_newdate;
loop
v_olddate:=v_newdate;
fetch c1 into v_newdate;
exit when c1%notfound;
if v_olddate>v_newdate then
v_currentdate:=v_olddate;
else
v_currentdate:=v_newdate;
end if;
end loop;
close c1;
这么长的第一段其实就是一句话:
select max(cgrq1) into v_currentdate
from t_syryxxfc
where grbm=v_grbm;
整个存储过程也是一句话:
select yxsys - sjxsys into v_wxsys
from t_syryxxfc x
where grbm=v_grbm
and cgrq1=(select max(cgrq1) from t_syryxxfc
where grbm=x.grbm);
------------------------------------------------------------------------
http://www.csdn.net/expert/topic/885/885688.xml?temp=.2983057
主 题: 关于sql语句优化的问题!
作 者: cranberry (催眠)
[我的回复]
insert into user2.table1
select * from user1.table1 x
where not exists (select 'x' from user2.table1
where key1=x.key1
and key2=x.key2
and key3=x.key3);