Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Queries: Selecting Data from a Table

SQL queries Next Page

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 expressions, 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