Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help on splitting the Name

user8979347May 4 2017 — edited May 4 2017

I have a requirement to separate out Title, First Name and Last Name from Full Name from the table in the sql query

Conditions :

1 >If Title is like (MR.|MR|MRS|MRS.|MS.|MS|DR.|DR) then separate it out to the Title column.

2> The Last part of Full Name is always Last Name.

3>Whatever is left out after removing Title and Last Name is First Name.

Example 1:

If Full Name is MR. Amir Ali KHAN

Title: MR

First name: MR. Amir Ali

Last name: KHAN

The output  of the sql query  should look like

Title  First_Name     Last_name 

MR     Amir Ali          KHAN

Example 2:

If Full Name is VENKAT MR MRS DR. SUBRAMANYAM

Title: <null>

First Name: VENKAT MR MRS DR.

Last Name: SUBRAMANYAM

The output  of the sql query  should look like

Title   First_Name                              Last_name 

Null     VENKAT MR MRS DR         SUBRAMANYAM

Thanks,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2017
Added on May 4 2017
11 comments
959 views