combining

From: "Frank Morton" <fmorton(at)base2inc(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: combining
Date: 2001-02-12 18:20:19
Message-ID: 012501c09520$74e7bc10$8455e5ce@edison
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jie Liang 2001-02-12 18:46:11 Re: combining
Previous Message clayton cottingham 2001-02-12 18:05:57 postgres's users take on onlamp