The SELECT statement retrieves information from a database for use by the client application. SELECT statements are also called queries. The information is delivered to the client application in the form of a result set. The client can then process the result set. For example, Interactive SQL displays the result set in the Results pane. Result sets consist of a set of rows, just like tables in the database.
SELECT statements contain clauses, which are commands that define the scope of the results to return. In the following SELECT syntax, each new line is a separate clause. Only the more common clauses are listed here.
SELECT select-list [ FROM table-expression ] [ WHERE search-condition ] [ GROUP BY column-name ] [ HAVING search-condition ] [ ORDER BY { expression | integer } ]
The clauses in the SELECT statement are as follows:
Although most queries operate on tables, queries may also retrieve data from other objects that have columns and rows, including views, other queries (derived tables) and stored procedure result sets. See FROM clause.
For information about GROUP BY, HAVING, and ORDER BY clauses, see Summarizing, grouping, and sorting query results.
Most of the clauses are optional, but if they are included then they must appear in the correct order.
See SELECT statement.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |