SELECT from two tables with different field names? - Mailing list pgsql-novice

From Pandu Poluan
Subject SELECT from two tables with different field names?
Date
Msg-id CAA2qdGXO+GdTheYeu2a_ZNgXCozuA=SvhyiZVLDSYxuuxD_dgQ@mail.gmail.com
Whole thread Raw
Responses Re: SELECT from two tables with different field names?
List pgsql-novice

Hello!

Due to some legacy apps, I end up with two tables with similar information, but with zero intersection (i.e., both tables are exclusive of each other).

For illustration:

table_one has the fields emp_id and fullname

table_two has the fields employee_id, first_name, and last_name

Now, I need a query that will search for employee ID in both tables and return his/her full name.

How do I do that? Will a simple UNION suffice?

Rgds,

pgsql-novice by date:

Previous
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: taking a sparse slice of an array
Next
From: Thomas Kellerer
Date:
Subject: Re: SELECT from two tables with different field names?