Single Table SELECT Statement Syntax

Here is the generic SELECT statement, as it is defined by the SQL99 standard, for selecting data from a single table. The query includes the SELECT command, followed by the list of identifiers (table or view columns); then comes the mandatory FROM clause that contains names of the tables, from which these columns are selected. The rest of the clause is optional, used to increase selectiveness of the query, as well as add some ordering capabilities. All of these pieces make up the complete SELECT statement.

SELECT [DISTINCT] [<qualifier>.]<column_name> |                    * |                    <expression>                     [AS <column_alias>],... FROM  <table_or_view_name> |        <inline_view>         [[AS] <table_alias>]  [WHERE <predicate>] [GROUP BY [<qualifier>.]<column_name>,...   [HAVING <predicate>] ] [ORDER_BY <column_name> |            <column_number>             [ASC | DESC],... ];

Of course, the statements that you would run against the three leading RDBMS do differ, both in syntax and usage.




SQL Bible
Microsoft SQL Server 2008 Bible
ISBN: 0470257040
EAN: 2147483647
Year: 2005
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net