安全云脑 SecMaster-DQL语法定义:DQL语句

时间:2025-01-26 10:47:50

DQL语句

  • 语法定义
      1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99100101102103104105106107108109110111112113114115116117
    query:  values  | {      select      | selectWithoutFrom      | query UNION [ ALL ] query      | query EXCEPT query      | query INTERSECT query    }    [ ORDER BY orderItem [, orderItem ]* ]    [ LIMIT { count | ALL } ]    [ OFFSET start { ROW | ROWS } ]    [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY]orderItem:  expression [ ASC | DESC ]select:  SELECT [ ALL | DISTINCT ]  { * | projectItem [, projectItem ]* }  FROM tableExpression  [ WHERE booleanExpression ]  [ GROUP BY { groupItem [, groupItem ]* } ]  [ HAVING booleanExpression ]  [ WINDOW windowName AS windowSpec [, windowName AS windowSpec ]* ]selectWithoutFrom:  SELECT [ ALL | DISTINCT ]  { * | projectItem [, projectItem ]* }projectItem:  expression [ [ AS ] columnAlias ]  | tableAlias . *tableExpression:  tableReference [, tableReference ]*  | tableExpression [ NATURAL ] [ LEFT | RIGHT | FULL ] JOIN tableExpression [ joinCondition ]joinCondition:  ON booleanExpression  | USING '(' column [, column ]* ')'tableReference:  tablePrimary  [ matchRecognize ]  [ [ AS ] alias [ '(' columnAlias [, columnAlias ]* ')' ] ]tablePrimary:  [ TABLE ] [ [ catalogName . ] schemaName . ] tableName  | LATERAL TABLE '(' functionName '(' expression [, expression ]* ')' ')'  | UNNEST '(' expression ')'values:  VALUES expression [, expression ]*groupItem:  expression  | '(' ')'  | '(' expression [, expression ]* ')'  | CUBE '(' expression [, expression ]* ')'  | ROLLUP '(' expression [, expression ]* ')'  | GROUPING SETS '(' groupItem [, groupItem ]* ')'windowRef:    windowName  | windowSpecwindowSpec:    [ windowName ]    '('    [ ORDER BY orderItem [, orderItem ]* ]    [ PARTITION BY expression [, expression ]* ]    [        RANGE numericOrIntervalExpression {PRECEDING}      | ROWS numericExpression {PRECEDING}    ]    ')'matchRecognize:      MATCH_RECOGNIZE '('      [ PARTITION BY expression [, expression ]* ]      [ ORDER BY orderItem [, orderItem ]* ]      [ MEASURES measureColumn [, measureColumn ]* ]      [ ONE ROW PER MATCH ]      [ AFTER MATCH            ( SKIP TO NEXT ROW            | SKIP PAST LAST ROW            | SKIP TO FIRST variable            | SKIP TO LAST variable            | SKIP TO variable )      ]      PATTERN '(' pattern ')'      [ WITHIN intervalLiteral ]      DEFINE variable AS condition [, variable AS condition ]*      ')'measureColumn:      expression AS aliaspattern:      patternTerm [ '|' patternTerm ]*patternTerm:      patternFactor [ patternFactor ]*patternFactor:      variable [ patternQuantifier ]patternQuantifier:      '*'  |   '*?'  |   '+'  |   '+?'  |   '?'  |   '??'  |   '{' { [ minRepeat ], [ maxRepeat ] } '}' ['?']  |   '{' repeat '}'
support.huaweicloud.com/usermanual-secmaster/secmaster_08_0017.html