Re: 3 way outer join dilemma

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: 3 way outer join dilemma
Дата
Msg-id 20030818171914.Y41521-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на 3 way outer join dilemma  (<terry@ashtonwoodshomes.com>)
Список pgsql-general
On Mon, 18 Aug 2003 terry@ashtonwoodshomes.com wrote:

> Here's what I have (simplified)
>
> SELECT t1.fid, t1.t1_data, t2.vid, t2.t2_data, t3.t3_data
> FROM t1, t2, t3
> WHERE t1.fid = X
>   AND t2.vid = Y
>   AND t3.fid = t1.fid
>   AND t3.vid = t2.vid
>
> Now, I discover that the record in t3 may not always exist, so somehow I
> want to do an outer join...
>
> SELECT t1.fid, t1.t1_data, t2.vid, t2.t2_data, t3.t3_data
> FROM t1, t2, OUTER JOIN t3 ON (t3.fid = t1.fid AND t3.vid = t2.vid)
> WHERE t1.fid = X
>   AND t2.vid = Y

Maybe:
FROM t1 CROSS JOIN t2 LEFT OUTER JOIN t3 ON ...



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Why lower's not accept an AS declaration ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why lower's not accept an AS declaration ?