Teradata String Manipulation - Remove last character

Purpose:\nCreate a query that eliminates the middle Initial

\n\n

Example

\n\n
Name\nSmith, John A\nJane, Mary S\n
\n\n

I would like an output such as this:

\n\n
Name\nSmith, John\nJane, Mary\n
\n\n

Solution:

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

nVector

posted on

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