Swaminathan K
asked on
Extract only names using regular expression in Oracle SQL
Hi Team,
I need to write a query to pull out the name from a given column, the column has values like
ID NAME
1 DR . A Sam
2 DR . A. Gopal
3 Sam Gopal , DR
4 Daniel Raj . DR .
output :
1 A Sam
2 A. Gopal
3 Sam Gopal
4 Daniel Raj
Select regexp_substr(NAME,'([a-zA-Z\.]+])|([^,\.]+)',1,1)
from dual;
Any help is really appreciated.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.