[GENERAL] Select from tableA - if not exists then tableB - Mailing list pgsql-general

From Patrick B
Subject [GENERAL] Select from tableA - if not exists then tableB
Date
Msg-id CAJNY3ivutOr4cGVOkNjR13rC23F-UiqAKEwOD=hHZvM6Ud8ubQ@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Select from tableA - if not exists then tableB
Re: [GENERAL] Select from tableA - if not exists then tableB
Re: [GENERAL] Select from tableA - if not exists then tableB
List pgsql-general
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?


I'm using PostgreSQL 9.1.

Thanks
Patrick

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] data transformation and replication
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Select from tableA - if not exists then tableB