27 August 2018        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);


Read great educational content like this and a lot more ! Create my free account now 🎁

Copied