27 Aug 18 · npack ·       Add to Favorites  

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

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds

Copied