Contents Index Selecting a complete table Using calculated columns

ASA Getting Started
  Selecting Data from Database Tables

Selecting columns from a table


You can limit the columns that a SELECT statement retrieves by listing the desired columns immediately after the SELECT keyword. This SELECT statement has the following syntax:

SELECT column-name-1column-name-2,...
FROM table-name

where column-name-1, column-name-2, and table-name should be replaced with the names of the desired columns and table you are querying.

The list of result-set columns is called the select list. It is separated by commas. There is no comma after the last column in the list, or if there is only one column in the list. Limiting the columns in this way is sometimes called a projection.

List the name, description, and color of each product

Rearranging columns 

The columns appear in the order in which you type them in the SELECT statement. If you want to rearrange the columns, simply change the order of the column names in the statement. For example, to put the description column on the left, use the following statement:

SELECT description, name, color
FROM product

Using calculated columns

Contents Index Selecting a complete table Using calculated columns