Re: [GENERAL] Select from tableA - if not exists then tableB

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: [GENERAL] Select from tableA - if not exists then tableB
Дата
Msg-id cbd430e2-bc54-bfb8-b3b8-ba0b7f45a213@aklaver.com
обсуждение исходный текст
Ответ на [GENERAL] Select from tableA - if not exists then tableB  (Patrick B <patrickbakerbr@gmail.com>)
Список pgsql-general
On 05/08/2017 02:56 PM, Patrick B wrote:
> Hi guys,
>
> I have two tables that supports the same data, but different table DDL
> (We are migrating all the data from one to another).
>
> What I need is basically:
>
> 1. Query looks for the data on table A,
> 2. if it doesn't find it on table A, go look for it on table B
>
> Now, how could I do that in a Select? Can you please provide some examples?

If you can provide some information:

1) The table schema

2) How the data is related between the two tables.

>
>
> I'm using PostgreSQL 9.1.
>
> Thanks
> Patrick


--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Patrick B
Дата:
Сообщение: [GENERAL] Select from tableA - if not exists then tableB
Следующее
От: David Rowley
Дата:
Сообщение: Re: [GENERAL] Select from tableA - if not exists then tableB