I am trying to extract 2 nd value in the the sting sunil;1000;kumar
SQL> select regexp_substr('sunil;1000;kumar','[^;]+',1,2) from dual;
REGE
----
1000
This works fine.
But, when the second field is null, ie., sunil;;kumar
I want the out put to be null only.
SQL> select regexp_substr('sunil;;kumar','[^;]+',1,2) from dual;
REGEX
-----
kumar
How can get this.