创建测试表及数据
createtabletest
(namevarchar2(10));
insertintotestvalues('2-15');
insertintotestvalues('2-33');
insertintotestvalues('2-3');
insertintotestvalues('12-8');
insertintotestvalues('12-22');
insertintotestvalues('12-3');执行
selectname,substr(name,1,instr(name,'-')-1)前,substr(name,instr(name,'-')+1,length(name)-instr(name,'-'))后fromtest截图