SELECT from two tables with different field names?

Поиск
Список
Период
Сортировка
От Pandu Poluan
Тема SELECT from two tables with different field names?
Дата
Msg-id CAA2qdGXO+GdTheYeu2a_ZNgXCozuA=SvhyiZVLDSYxuuxD_dgQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: SELECT from two tables with different field names?  (Thomas Kellerer <spam_eater@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: "Jean-Yves F. Barbier"
Дата:
Сообщение: Re: taking a sparse slice of an array
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: SELECT from two tables with different field names?