combining - Mailing list pgsql-sql

From Frank Morton
Subject combining
Date
Msg-id 012501c09520$74e7bc10$8455e5ce@edison
Whole thread Raw
Responses Re: combining
Re: combining
List 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




pgsql-sql by date:

Previous
From: clayton cottingham
Date:
Subject: postgres's users take on onlamp
Next
From: Jie Liang
Date:
Subject: Re: combining