17.10 - Example: Accessing Serial ID Characters - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1145-171K
Language
English (United States)

If we want the last five characters of the serial ID, which represent manufacturing sequence number, another substring can be accessed.

   SELECT make, SUBSTRING (sn FROM 11) AS sequence 
   FROM autos
   WHERE SUBSTRING (sn FROM 3 FOR 3) = 'USA';