Chapter 10. String Functions
A string is a value that can contain alphabetical characters, digits, and other characters (e.g., the ampersand, the dollar sign). Although a string can contain numbers, they are not considered numeric values. It’s a matter of context and perspective. For instance, postal codes in the United States are all digits, but you shouldn’t store them as integers because the postal code for 02138 would become 2138. You should use a string to store the postal code.
To make the handling of strings easier, MySQL provides many built-in
functions. You can format text for nicer results, make better expressions in
a WHERE clause, or otherwise extract and manipulate data from a
string or column. Therefore, in this chapter, we’ll go through several
string functions, grouping them by similar features, and provide examples of
how they might be used.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access