pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Morton <fmorton@base2inc.com>
To: pgsql-sql@postgresql.org
Subject: combining
Date: Mon, 12 Feb 2001 13:20:19 -0500
Message-ID: <012501c09520$74e7bc10$8455e5ce@edison> (raw)

I'll really appreciate help on this if anyone will do so. I'm
used to single-table stuff, but not sure the best way to
do things with multiple tables, but here goes:

Given two tables with a common "id" field, first table columns:

id
lastname

Second table columns:

id
type
content

These two queries get me what I want from each table:

select unique id from table1 where lastname='morton';
select unique id from table2 where ((type = "pie") and (content = 'apple));

What is the best way to combine these into one query?

Thanks.

Frank





view thread (3+ messages)  latest in thread

Message-ID: <012501c09520$74e7bc10$8455e5ce@edison>
Permalink:  ../012501c09520$74e7bc10$8455e5ce@edison/
Also on:    postgresql.org/message-id/012501c09520$74e7bc10$8455e5ce@edison

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: fmorton@base2inc.com
  Subject: Re: combining
  In-Reply-To: <012501c09520$74e7bc10$8455e5ce@edison>
  References: <012501c09520$74e7bc10$8455e5ce@edison>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox