Chapter 10 – Strings

“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 LENGTH Command Counts Characters

image

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

The LENGTH Command – Spaces can Count too

image

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

The LENGTH Command and Character Data

Last_Name  

 Lnth 

Chambers

20

Coffing

20

Harrison

20

Get Tera-Tom Genius Series - DB2 SQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.