Appendix C. Operator and Function Reference
This appendix lists the operators and functions you can use to construct expressions in SQL statements. Unless otherwise indicated, the operators and functions listed here have been present in MySQL at least as early as MySQL 4.1.0. Changes made since then are so noted.
The expression demonstrates how to use an operator or function, and the result shows the value that results from evaluating the expression. For example:
This means that the function call LOWER('ABC') produces the string result 'abc'. You can try the examples shown in this appendix for yourself using the mysql program. To try the preceding example, invoke mysql, type in the example expression with SELECT in front of it and a semicolon after it, and press Enter:
mysql> SELECT LOWER('ABC'); +--------------+ | LOWER('ABC') | +--------------+ | abc | +--------------+
Examples include complete SELECT statements for functions that cannot be demonstrated otherwise. The "Summary Functions" section is written that way because those functions make no sense except in reference to a particular table.
Certain types of function arguments occur repeatedly and are represented by names with the following conventional meanings:
Other argument names are used less often and are defined where used. Square brackets () in syntax descriptions indicate optional parts of operator or function call sequences. Evaluation of an expression often involves type conversion of the values in that expression. See Chapter 3, "Working with Data in MySQL," for details on the circumstances under which type conversion occurs and the rules that MySQL uses to convert values from one type to another.