LEFT JOIN on one and/or another column

Поиск
Список
Период
Сортировка
От Octavio Alvarez
Тема LEFT JOIN on one and/or another column
Дата
Msg-id 1533.63.84.67.25.1075350420.squirrel@alvarezp.ods.org
обсуждение исходный текст
Ответы Re: LEFT JOIN on one and/or another column
Список pgsql-sql
Hi. I have a table with two foreign keys (1 field each), like in
id                | serialext_key_original  | integerext_key_exception | integer

They mean different things, as one refers to a typical value, and the
other one refers to an exception that applies for that tuple.

Each key references a different table, one with typical data, and one with
exception data.

I'd like to join on the original, except when exception <> NULL, but I
can't quite figure out how to do so.

Can anyone help?

Thanks you. :-)

Octavio.

-- 
Octavio Alvarez.
E-mail: alvarezp@alvarezp.ods.org.

Agradezco que sus correos sean enviados siempre a esta dirección.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Question about isolation
Следующее
От: "Kumar"
Дата:
Сообщение: SQL Query for Top Down fetching of childs