日期:2014-05-17 浏览次数:20961 次
select decode(instr(col,',',1,1),0,col,substr(col,1,instr(col,',',1,1)-1)) from tab
------解决方案--------------------
SQL> select substr('123,456',0,instr('123,456',',')-1) from dual;
SUBSTR('123,456',0,INSTR('123,
------------------------------
123
------解决方案--------------------
select substr(col ,1,instr(col,',')-1) from tab;