Re: NATURAL JOINs

Поиск
Список
Период
Сортировка
От Richard Broersma
Тема Re: NATURAL JOINs
Дата
Msg-id 396486430810130959t223d217fndc1c67d4765c4725@mail.gmail.com
обсуждение исходный текст
Ответ на NATURAL JOINs  (Reg Me Please <regmeplease@gmail.com>)
Ответы Re: NATURAL JOINs
Список pgsql-general
On Mon, Oct 13, 2008 at 9:52 AM, Reg Me Please <regmeplease@gmail.com> wrote:

> Is there a way to know how a NATURAL JOIN is actually done?

Here is what the manual says about natural joins:
http://www.postgresql.org/docs/8.3/interactive/queries-table-expressions.html#QUERIES-FROM

...
Finally, NATURAL is a shorthand form of USING: it forms a USING list
consisting of exactly those column names that appear in both input
tables. As with USING, these columns appear only once in the output
table.
...

...
USING is a shorthand notation: it takes a comma-separated list of
column names, which the joined tables must have in common, and forms a
join condition specifying equality of each of these pairs of columns.
Furthermore, the output of a JOIN USING has one column for each of the
equated pairs of input columns, followed by all of the other columns
from each table. Thus, USING (a, b, c) is equivalent to ON (t1.a =
t2.a AND t1.b = t2.b AND t1.c = t2.c) with the exception that if ON is
used there will be two columns a, b, and c in the result, whereas with
USING there will be only one of each.
...

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

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

Предыдущее
От: Reg Me Please
Дата:
Сообщение: NATURAL JOINs
Следующее
От: "Raj K"
Дата:
Сообщение: Re: Reg: Permission error in Windows psql while trying to read sql commands from file