23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

* expr [ [ AS ] [ ' ] column_alias [ ' ] ]<br />

SELECT<br />

Specifies a list of expressions, called a select list, whose results will form columns<br />

of the result table. Typically, the expression is a column name from a table named in<br />

the FROM clause. The expression can also be any supported mathematical expression,<br />

scalar function, or aggregate function that returns a value.<br />

The optional column_alias argument specifies a new heading for the associated<br />

column in the result table. You can also use the column_title in an ORDER BY clause.<br />

Enclose the new title in single or double quotation marks if it contains spaces or other<br />

special characters, including hyphens.<br />

Note: A table alias cannot be used to qualify a column alias. A column alias can only<br />

be used without a qualifier because it is not a part of any table definition.<br />

[ table | alias.]column_name , ... ]<br />

Specifies a list columns from a particular table or alias.<br />

Examples Both these statements return all the columns in the customer table to the select list:<br />

SELECT * FROM Customer;<br />

SELECT Customer.* FROM Customer;<br />

The table_name.* syntax is useful when the select list refers to columns in multiple tables and<br />

you want to specify all the columns in one of those tables. For example:<br />

SELECT Customer.CustNum, Customer.Name, Invoice.*<br />

FROM Customer, Invoice ;<br />

The following example illustrates using the column_alias option to change the name of the<br />

column:<br />

47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!