SELECT code, name, dept, occupation FROM staff WHERE instr(code, '001') > 0; 等同于 SELECT code, name, dept, occupation FROM staff WHERE code LIKE '%001%' ;
-- Created on 2010-12-22 by CHEN declare -- Local variables here i varchar2(2); begin -- Test statements here i := instr('',','); if i is null then dbms_output.put_line(' i is empty'); end if; end;