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!

remove middle name from lastname, firstname middlename

g2500Jun 9 2017 — edited Jun 13 2017

Hi All,

ORACLE 10g

How can i remove the middle name from a name field?

PETERS, SIMON DANIELS

Tried something like this in SQL Server...

SUBSTRING(name, CHARINDEX(',', name) + 2, LEN(name) - CHARINDEX(',', name) + 1)

        + '.' + SUBSTRING(name, 1, CHARINDEX(',', name) - 1)

OUTPUT:

SIMON.PETERS

Thanks

AJR

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 11 2017
Added on Jun 9 2017
28 comments
3,508 views