If table A value IS NULL then table B

Поиск
Список
Период
Сортировка
От Marco Lazzeri
Тема If table A value IS NULL then table B
Дата
Msg-id 1074880900.3725.17.camel@macbeth.intranet.noze.it
обсуждение исходный текст
Ответы Re: If table A value IS NULL then table B  (Martín Marqués<martin@bugs.unl.edu.ar>)
Re: If table A value IS NULL then table B  ("Ezra Epstein" <eepstein@prajnait.com>)
Список pgsql-general
I've got a table called 'main' described as follow

CREATE TABLE main (
  id_other_table INT,
  value CHAR
);

and a table called 'other' described as follow

CREATE TABLE other (
  id INT PRIMARY KEY,
  value CHAR
);

I want to write a query on table 'main' that if 'id_other_table' is null
returns value from itself, from table 'other' otherwise.

Thank you very much, have a wonderful day!

Marco
--
Marco Lazzeri [ n o z e  S.r.l. ]
Via Giuntini, 25/29 - 56023 Navacchio - Cascina (PI)
Tel +39  (0)50 754380 - Fax +39 (0)50 754381
mailto:marco.lazzeri@noze.it - http://www.noze.it


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Recursive optimization of IN subqueries
Следующее
От: "Lee Harr"
Дата:
Сообщение: Re: sequence in schema -- broken default