A column expression is a reference to a column in a table, named column_ref in the syntax of an expression.
The syntax of a list expression is as follows:
{ column_name
| table_name.column_name
| database_name.table_name.column_name
| table_name.*
}
List expressions can appear in multiple locations within an SQL statement. For example:
- In the select-list of a
SELECTstatement. - In the conditions of the
WHEREclause. - In the
ORDER BYclause. - In the
GROUP BYclause. - In the
VALUESclause of anINSERTstatement. - In the
SETclause of anUPDATEstatement.
List expressions are one of the most fundamental forms of expression in SQL statements. For example:
SELECT first_name, last_name FROM employees WHERE salary > 5000 ORDER BY last_name;
In the preceding statements, first_name, last_name, and salary are all list expressions.
