Select
- Last Updated: July 30, 2025
- 2 minute read
- DataDirect Connectors
- ODBC
- Salesforce 8.0
- Documentation
Purpose
Use the Select statement to fetch results from one or more tables.
Syntax
SELECT select_clause from_clause
[where_clause]
[groupby_clause]
[having_clause]
[{UNION [ALL | DISTINCT] |
{MINUS [DISTINCT] | EXCEPT [DISTINCT]} |
INTERSECT [DISTINCT]} select_statement]
[limit_clause]
where:
select_clause- specifies the columns from which results are to be returned by the query. See "Select clause" for a complete explanation.
from_clause- specifies one or more tables on which the other clauses in the query operate. See "From clause" for a complete explanation.
where_clause- is optional and restricts the results that are returned by the query. See "Where clause" for a complete explanation.
groupby_clause- is optional and allows query results to be aggregated in terms of groups. See "Group By clause" for a complete explanation.
having_clause- is optional and specifies conditions for groups of rows (for example, display only the departments that have salaries totaling more than $200,000). See "Having clause" for a complete explanation.
UNION- is an optional operator that combines the results of the left and right Select statements into a single result. See "Union operator" for a complete explanation.
INTERSECT- is an optional operator that returns a single result by keeping any distinct values from the results of the left and right Select statements. See "Intersect operator" for a complete explanation.
EXCEPT|MINUS- are synonymous optional operators that returns a single result by taking the results of the left Select statement and removing the results of the right Select statement. See "Except and Minus operators" for a complete explanation.
orderby_clause- is optional and sorts the results that are returned by the query. See "Order By clause" for a complete explanation.
limit_clause- is optional and places an upper bound on the number of rows returned in the result. See "Limit clause" for a complete explanation.