Substr Query Question in oracle sql
Posted on 2011-03-04
I have the following select statement with substring
SUBSTR (NVL (historical_separate.work_done, active_separate.work_done),1,INSTR (NVL(historical_separate.work_done, active_separate.work_done),',',1,1)- 1)AS "Repair Code"
say I have data in the field of M21,17,5
The above statement gives me M21
but if I have data of only M21
it gives me blank
I need to have it show M21 not blank. How do I accomplish this?