The question is How get middle name from full name column in SQL Table? Full name can be like this.
Santosh kumar singh
Raj Narayan verma
Middle name is Kumar and Narayan etc.
Solution.
Use instr to get the position of first space and second space.use substr to get the string from first space +1 to 2nd space - 1. I hope you will get solution.
Example.
Using substr function it will get the result of middle names.
Substr(colname,instr(colname, ' ', 1,1),instr(colname,' ' , -1,1))
Santosh kumar singh
Raj Narayan verma
Middle name is Kumar and Narayan etc.
Solution.
Use instr to get the position of first space and second space.use substr to get the string from first space +1 to 2nd space - 1. I hope you will get solution.
Example.
Using substr function it will get the result of middle names.
Substr(colname,instr(colname, ' ', 1,1),instr(colname,' ' , -1,1))
Comments
Post a Comment
Please avoid link comments