SQL SELECT statement

zhaozj2021-02-17  77

SELECT

Retrieve rows from the database and allow you to select one or more rows or columns from one or more tables. Although the complete syntax of the SELECT statement is more complicated, its main clause can be summarized as follows:

SELECT SELECT_LIST [INTO new_TABLE] from table_source [Where search_condition] [GROUP BY Group_BY_EXPIPRESSION] [HAVING Search_Condition] [ORDER BY ORDER_EXPISSION [ASC | DESC]]

A UNION operator can be used between queries to combine the results of the query into a single result set.

grammar

Select Statement :: = [ORDER BY {Order_BY_EXPIPRESSION | Column_Position [ASC | DESC]} [, ... n]] [compute {{avg | count | max | min | SUM} (Expression)} [,. ..n] [by expression [, ... n]]]] [for {browse | xml {raw | auto | expressit} [, xmldata] [, elements] [, binary base64]}] [option ( [, ... n])]]

:: = { | ()} [union [all] ) [... n]]

:: = SELECT [All | Distinct] [{TOP INTEGER | TOP INTEGER Percent} [with TIES]] [INTO NEW_TABLE] [from {} [, ... n]] [ WHERE ] [group by [all] group_by_expression [, ... n] [with {cube | rollup}]] [haVing ]

转载请注明原文地址:https://www.9cbs.com/read-31112.html

New Post(0)