27 Aug 18 · npack ·       Add to Favorites   Report

Teradata String Manipulation - Remove last character

Purpose: Create a query that eliminates the middle Initial

Example

Name
Smith, John A
Jane, Mary S

I would like an output such as this:

Name
Smith, John
Jane, Mary

Solution:

SELECT SUBSTR('SMITH, JOHN A', 1, CHAR_LENGTH(NAME)-1);

npack

posted on 27 Aug 18

Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too

Copied