Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group