16.20 - Example: Accessing Serial ID Characters - Teradata Database

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

prodname
Advanced SQL Engine
Teradata Database
vrm_release
16.20
created_date
March 2019
category
Programming Reference
featnum
B035-1145-162K

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';