select nvl2(translate('20140001', '\1234567890', '\'), '0', '1'from dual;

例子:

selectcasewhen length(eng_code)=8thensubstr(eng_code, 0, 4) elsenullend eng_codebefore,casewhen length(eng_code)=8thensubstr(eng_code, 5, 4) elsenullend eng_codeafter from eng_info where eng_nature='1'and length(eng_code)=8andnvl2(translate(eng_code , '\1234567890', '\'), '0', '1')='1' ;