What's the purpose of SQL keyword “AS”?

前端 未结 9 1597
我在风中等你
我在风中等你 2020-11-30 20:37

You can set table aliases in SQL typing the identifier right after the table name.

SELECT * FROM table t1;

You can even use the keyword

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 21:13

    The AS in this case is an optional keyword defined in ANSI SQL 92 to define a < ,commonly known as alias for a table.

     ::=
                
    [ [ AS ] [ ] ] | [ AS ] [ ] | ::=
    ::= ::= [ { }... ] Syntax Rules 1) A immediately contained in a
    TR is exposed by TR. A
    immediately contained in a
    TR is exposed by TR if and only if TR does not specify a .

    It seems a best practice NOT to use the AS keyword for table aliases as it is not supported by a number of commonly used databases.

    提交回复
    热议问题