Re: Joins within a table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Joins within a table
Дата
Msg-id 28878.1181695869@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Joins within a table  (Steve Lefevre <lefevre.10@osu.edu>)
Список pgsql-novice
Steve Lefevre <lefevre.10@osu.edu> writes:
> I'm trying to do a JOIN within a table. In MySQL, I would do

> SELECT  main_table.field, join_table.field
> FROM main_table
> LEFT JOIN main_table AS join_table ON join_table.id = main_table.parent_id

Yeah, that's the same way you'd do a self-join in Postgres.

> However, in the Postgres documentation, I don't see anything on JOIN AS.

Where did you look?  Maybe you are confusing the alias clause with the
join clause --- they are two different constructs.

            regards, tom lane

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

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: unreasonable run time for vacuum analyze?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: unreasonable run time for vacuum analyze?