Re: ERROR: FULL JOIN is only supported with merge-joinable join conditions

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: ERROR: FULL JOIN is only supported with merge-joinable join conditions
Дата
Msg-id 20060316201709.GB4474@ns.snowman.net
обсуждение исходный текст
Ответ на ERROR: FULL JOIN is only supported with merge-joinable join conditions  (Harco de Hilster <harcoh@ATConsultancy.nl>)
Список pgsql-general
* Harco de Hilster (harcoh@ATConsultancy.nl) wrote:
> ERROR:  FULL JOIN is only supported with merge-joinable join conditions

I'm not a big fan of that error either, honestly.

> select *
> from A
> full outer join B on A.f1 = B.f1  and  ((A.ExpTime IS NULL AND B.ExpTime
> IS NULL) OR (A.ModTime <= B.ExpTime AND (B.ExpTime > A.ExpTime OR
> B.ExpTime IS NULL)))

What about:

inner join
union all
left join
union all
right join

?  You'd need to add a couple where clauses to make the left/right joins
only return rows not returned by the inner join.  Honestly, that setup
is pretty ugly though and you might consider trying to figure out a way
to clean it up.

It'd be nice if Postgres would basically just do this for you. :/
Perhaps one of the other folks can explain why it doesn't just work.

    Enjoy,

        Stephen

Вложения

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Replication & web apps
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How do I make a timestamp column default to current time