I have texts like below in a column-
a|bbb|cc|dddd
d||ff|gg
a|zzzz|pp|rrr
I want to display the text between 1st "|" and 2nd "|" symbols. Below given should be the output.
Output
------
bbb
null
zzzz
Tried with below query, but it gives me 'ff' instead of null.
SELECT regexp_substr('d||ff|gg','[^|]+',1,2) regexp_substr FROM dual;
How should I go about doing this?