zoukankan      html  css  js  c++  java
  • select语句语法&说明

    SELECT

    从数据库中检索行,并允许从一个或多个表中选择一个或多个行或列。虽然 SELECT 语句的完整语法较复杂,但是其主要的子句可归纳如下:

    SELECT select_list
    [ INTO new_table ]
    FROM table_source
    [ WHERE search_condition ]
    [ GROUP BY group_by_expression ]
    [ HAVING search_condition ]
    [ ORDER BY order_expression [ ASC | DESC ] ]

    可以在查询之间使用 UNION 运算符,以将查询的结果组合成单个结果集。

    语法

    SELECT statement ::=
        < query_expression >
        [ ORDER BY { order_by_expression | column_position [ ASC | DESC ] }
            [ ,...n ]    ]
        [ COMPUTE

            { { AVG | COUNT | MAX | MIN | SUM } ( expression ) } [ ,...n ]
            [ BY expression [ ,...n ] ]

        
    ]
        [ FOR { BROWSE | XML { RAW | AUTO | EXPLICIT }

                [ , XMLDATA ]
                [ , ELEMENTS ]
                [ , BINARY base64 ]
            }
    ]
        [ OPTION ( < query_hint > [ ,...n ]) ]

    < query expression > ::=
        { < query specification > | ( < query expression > ) }
        [ UNION [ ALL ] < query specification | ( < query expression > ) [...n ] ]

    < query specification > ::=
        SELECT [ ALL | DISTINCT ]
            [ { TOP integer | TOP integer PERCENT } [ WITH TIES ] ]
            < select_list >
        [ INTO new_table ]
        [ FROM { < table_source > } [ ,...n ] ]
        [ WHERE < search_condition > ]
        [ GROUP BY [ ALL ] group_by_expression [ ,...n ]
            [ WITH { CUBE | ROLLUP } ]
        ]
        [HAVING <search_condition>]

  • 相关阅读:
    js布尔型
    C#函数(十一)
    JavaScript+jQuery从小工到专家学习笔记数值
    C#函数(十)
    C#函数(九)
    jquery 操作复选框 下拉框
    jquery select操作大全
    Jquery与Json实现Ajax
    如何打造创业团队
    jquery select操作大全
  • 原文地址:https://www.cnblogs.com/zen/p/293110.html
Copyright © 2011-2022 走看看