I am trying to substring a text depending on the varying positions of the "_"
The query in SQL =
CASE
WHEN SUBSTR(DSLAM_NAME,1,instr(DSLAM_NAME,'_')-1) IS NULL THEN SUBSTR(DSLAM_NAME,1,instr(DSLAM_NAME,'-')-1)
ELSE
SUBSTR(DSLAM_NAME,1,instr(DSLAM_NAME,'_')-1)
... View more