Çó½â~~~~×Ô¼ºÐ´Ò»¸öfunction°Ñ£¬ÓÃinstrÀ´ÊµÏÖ¡£ SQL code: create or replace function fun(s in varchar2,s1 in varchar2) return number is i number := 1; begin while instr(s,s1,1,i) > 0 loop i := i + 1; end loop; return i; end fun; /
INSTR('CORPORATE FLOOR','OR', 3, 2)ÖУ¬Ô´×Ö·û´®Îª'CORPORATE FLOOR', Ä¿±ê×Ö·û´®Îª'OR'£¬ÆðʼλÖÃΪ3£¬È¡µÚ2¸öÆ¥ÅäÏîµÄλÖᣠSQL code: create or replace function fun(s in varchar2,s1 in varchar2) return number is i number := 0; begin while instr(s,s1,1,i+1) > 0 loop i := i + 1; end loop; return i; end fun; /
sql2005 select *from v_ddxx where d_sfsc='0' and (g_ssbm='1001' or g_ssbm='1002') and (xxf>0 and xxfwzf <>0 ),Ö´ÐÐËÙ¶ÈÂýµÄÒªËÀ£¬µ«ÊÇÈç¹û°Ñ(xxf>0 and ......