Contents Index SQL queries Selecting all columns from a table

ASA SQL User's Guide
  Queries: Selecting Data from a Table

The SELECT list: specifying columns


The select list 

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. 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 what expressions can consist of, see Expressions.

The following sections provide examples of the kinds of expressions you can use in a select list.


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

Contents Index SQL queries Selecting all columns from a table