日期:2014-05-17 浏览次数:20744 次
--帮你写了个例子,只是不知道你的字符串的SELECT b.* FROM bims_account_2012 b WHERE NOT EXISTS (SELECT 1 FROM rim_account_2012 a WHERE upper(a.account)=upper(b.account) and a.city=b.city) and b.city='崇左',如何进行更新或新增到你的表,其实都差不多的,不懂再问吧 create table t( id int, val varchar2(2000) ); create table t1( id int, empcou int, empdescr varchar2(2000) ); insert into t values(1,'select count(1) from emp'); insert into t1 values(1,0,''); declare strsql varchar2(2000); cou varchar2(20); cursor c is select * from t; begin for i in c loop if instr(i.val,'count')>1 then execute immediate i.val into cou; update t1 set empcou=cou where t1.id=1; else dbms_output.put_line('对于字符串你打算如何统计呢?'); end if; end loop; end; / select * from t1;
------解决方案--------------------
只是例子而已呀,去拼接字符串不就可以了,而且上面也没关联值呀,肯定不能这样写的