Combining queries

From: Mark Kelly <pgsql(at)wastedtimes(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Combining queries
Date: 2011-02-19 13:25:48
Message-ID: 201102191325.48594.pgsql@wastedtimes.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

Thanks,

Mark

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2011-02-19 13:47:15 Re: Combining queries
Previous Message Michael Wood 2011-02-19 12:48:16 Re: Help loading data. Error code page 850