Re: syntax of outer join in 7.1devel

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: syntax of outer join in 7.1devel
Дата
Msg-id 6858.976116402@sss.pgh.pa.us
обсуждение исходный текст
Ответ на syntax of outer join in 7.1devel  ("Poul L. Christiansen" <poulc@cs.auc.dk>)
Список pgsql-general
"Poul L. Christiansen" <poulc@cs.auc.dk> writes:
> But how do I make an outer join?
> What's the syntax?
> I will RTFM if someone points me to the docs :-)

I'm afraid I haven't updated the FM yet :-( ... but you could look at
the examples in the JOIN regress test, src/test/regress/sql/join.sql.

Or, from the SQL92 spec, here's the grammar:

         <from clause> ::= FROM <table reference> [ { <comma> <table reference> }... ]

         <table reference> ::=
                <table name> [ [ AS ] <correlation name>
                    [ <left paren> <derived column list> <right paren> ] ]
              | <derived table> [ AS ] <correlation name>
                    [ <left paren> <derived column list> <right paren> ]
              | <joined table>

         <derived table> ::= <table subquery>

         <derived column list> ::= <column name list>

         <column name list> ::=
              <column name> [ { <comma> <column name> }... ]

         <joined table> ::=
                <cross join>
              | <qualified join>
              | <left paren> <joined table> <right paren>

         <cross join> ::=
              <table reference> CROSS JOIN <table reference>

         <qualified join> ::=
              <table reference> [ NATURAL ] [ <join type> ] JOIN
                <table reference> [ <join specification> ]

         <join specification> ::=
                <join condition>
              | <named columns join>

         <join condition> ::= ON <search condition>

         <named columns join> ::=
              USING <left paren> <join column list> <right paren>

         <join type> ::=
                INNER
              | <outer join type> [ OUTER ]
              | UNION

         <outer join type> ::=
                LEFT
              | RIGHT
              | FULL

         <join column list> ::= <column name list>

We don't do UNION JOIN yet, but I think everything else shown in this
snippet is implemented ...

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "Poul L. Christiansen"
Дата:
Сообщение: syntax of outer join in 7.1devel
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Clarification