SQL Functions

Most commercial relational database management systems (and the ANSI standard, to a more limited extent) support SQL functions to work with character, numeric, and date data, as well as to convert from one datatype to another and to perform some conditional operations. These are covered in Chapter 11. There is also a group of functions for working with set results, and they are discussed in Chapters 5 and 6.

Here's an example of a query using the LENGTH function to find out how long each book title is. (The ORDER BY sorts the results by size to show how LENGTH works.)

SQL
select  title, length (title) as size from titles order by length(title) title size ================================================================ ==== Net Etiquette ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.