skip to main content
Supported SQL and Extensions : Oracle Eloqua, HubSpot, and Marketo : Select : Select Clause
 

Try DataDirect Cloud Now
Select Clause
For an Eloqua, HubSpot, or Marketo data store, use the Select clause to specify with a list of column expressions that identify columns of values that you want to retrieve or an asterisk (*) to retrieve the value of all columns.

Syntax

SELECT [{TOP number}]
[ALL | DISTINCT] {* | column_expression
[[AS] column_alias]
[,column_expression
[[AS] column_alias], ...]}
where:
TOP returns the limited number of records from a result set as specified by number.
column_expression can be simply a column 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_expression can also include aggregate functions. See Aggregate Functions 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, SELECT last_name, first_name, hire_date).
Column names can be prefixed with the table name or table alias. For example, SELECT 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

Notes

*Separate multiple column expressions with commas (for example, SELECT last_name, first_name, hire_date).
*Column names can be prefixed with the table name or table alias. For example, SELECT emp.last_name or e.last_name, where e is the alias for the table emp.
*NULL values are not treated as distinct from each other. The default behavior is that all result rows be returned, which can be made explicit with the keyword ALL.
* Aggregate Functions