Oracle get substring before a space
SELECT Rtrim(Substr('123642134 10',1,Instr('123642134 10',' '))) AS quarter_cd FROM dual;
Uses of string function used in upper query
- Instr()- to get position of any character or space from the given string.
- Substr()- to get substring from given string.
- Rtrim()- to remove spaces from right side.