O'Reilly logo

V14 Certification: Teradata SQL by Tom Coffing, Leona Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12 – Substring and Positioning Functions

“It’s always been and always will be the same in the world: the horse does the work and the coachman is tipped.”

– Anonymous

The CHARACTERS Command Counts Characters

image

The CHARACTERS command counts the number of characters. If ‘Tom’ was in the Employee_Table, his length would be 3

The CHARACTERS Command – Spaces can Count too

SELECT    'T o m' AS First_Name

,CHARACTERS('T o m')  AS Lnth

Answer Set

 First_Name   

 Lnth 

  T o m

  5

If ‘T o m’ was in the Employee_Table, his length would be 5. Yes, spaces do count as characters.

The CHARACTERS Command and Char(20) Data

 Last_Name    ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required