combining

Поиск
Список
Период
Сортировка
От Frank Morton
Тема combining
Дата
Msg-id 012501c09520$74e7bc10$8455e5ce@edison
обсуждение исходный текст
Ответы Re: combining  (Jie Liang <jliang@ipinc.com>)
Re: combining  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: clayton cottingham
Дата:
Сообщение: postgres's users take on onlamp
Следующее
От: Jie Liang
Дата:
Сообщение: Re: combining