Re: alias required by standard or PostgreSQL?
| От | Tom Lane |
|---|---|
| Тема | Re: alias required by standard or PostgreSQL? |
| Дата | |
| Msg-id | 9788.1196662409@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | alias required by standard or PostgreSQL? ("Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl>) |
| Список | pgsql-sql |
"Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl> writes:
> "select * from (select * from table_name)"
> PostgreSQL complains with
> ERROR: subquery in FROM must have an alias
> HINT: For example, FROM (SELECT ...) [AS] foo.
> Is the alias required by the ISO standard
Yes. A FROM-clause entry is defined as
<table reference> ::= <table name> [ [ AS ] <correlation name> [ <left paren>
<derivedcolumn list> <right paren> ] ] | <derived table> [ AS ] <correlation name> [
<leftparen> <derived column list> <right paren> ] | <joined table>
<derived table> ::= <table subquery>
Note that the brackets show that a <correlation name> (ie, an alias)
is optional for a regular table, but not for a subquery.
regards, tom lane
В списке pgsql-sql по дате отправления: