Re: Combining queries

Поиск
Список
Период
Сортировка
От Sean Davis
Тема Re: Combining queries
Дата
Msg-id AANLkTikgjJKzvf9thR3EGRDc2gyE0nQvkjWPLN0o-y9L@mail.gmail.com
обсуждение исходный текст
Ответ на Combining queries  (Mark Kelly <pgsql@wastedtimes.net>)
Ответы Re: Combining queries  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-novice


On Sat, Feb 19, 2011 at 8:25 AM, Mark Kelly <pgsql@wastedtimes.net> wrote:
Hi.

If I have two queries:

SELECT pub_id as id, email FROM publication WHERE email_accepted = TRUE;

and

SELECT contact_id as id, email FROM person WHERE email_accepted = TRUE;

is there any way I could combine these into a single query? I'd like to be
able to create a view of all email-able entities in the system.


Hi, Mark.

Take a look at sql UNION--this is not postgresql specific.  

Sean


 

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

Предыдущее
От: Mark Kelly
Дата:
Сообщение: Combining queries
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: Updating a table field with a consecutive number