The select list: Specifying columns

The select list comprises one or more objects from which to query data. The select list commonly consists of a series of column names separated by commas, or an asterisk as shorthand to represent all columns. More generally, the select list can include one or more expressions, separated by commas. There is no comma after the last column in the list, or if there is only one column in the list.

The general syntax for the select list looks like this:

SELECT expression [, expression  ]...

If any table or column name in the list does not conform to the rules for valid identifiers, you must enclose the identifier in double quotes.

The select list expressions can include * (all columns), a list of column names, character strings, column headings, and expressions including arithmetic operators. You can also include aggregate functions, which are discussed in Summarizing, grouping, and sorting query results.

For more information about expressions, see Expressions.


Selecting all columns from a table
Selecting specific columns from a table
Renaming columns in query results
Character strings in query results
Computing values in the SELECT list
Eliminating duplicate query results