skip to main content
SQL Statements for Flat-File Drivers : Select Statement : Select Clause
  
Select Clause
Follow Select with a list of column expressions you want to retrieve or an asterisk (*) to retrieve all fields.
SELECT [DISTINCT] {* | column_expression, [[AS] column_alias]. . .}
column_expression can be simply a field name (for example, LAST_NAME). More complex expressions may include mathematical operations or string manipulation (for example, SALARY * 1.05). See SQL Expressions for details.
column_alias can be used to give the column a descriptive name. For example, to assign the alias DEPARTMENT to the column DEP:
SELECT dep AS department FROM emp
Separate multiple column expressions with commas (for example, LAST_NAME, FIRST_NAME, HIRE_DATE).
Field names can be prefixed with the table name or alias. For example, EMP.LAST_NAME or E.LAST_NAME, where E is the alias for the table EMP.
The Distinct operator can precede the first column expression. This operator eliminates duplicate rows from the result of a query. For example:
SELECT DISTINCT dep FROM emp
* Aggregate Functions