Re: Select from multiple tables

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Select from multiple tables
Дата
Msg-id 200306061958.58817.dev@archonet.com
обсуждение исходный текст
Ответ на Select from multiple tables  (Jon Earle <je_pgsql@kronos.honk.org>)
Список pgsql-general
On Friday 06 Jun 2003 4:17 pm, Jon Earle wrote:
> Hi,
>
> I want to select data from two tables, with the keying information for the
> second table coming from the select results of the first.  Can this be
> done in one call, or will I need to resort to two calls - one to get the
> record from the first table, then a second call to get the record from the
> second table based on a key contained in the first results set?

A join?

SELECT * FROM tbl_a,tbl_b WHERE tbl_b.some_field=tbl_a.other_field;

Or have I got the wrong end of the stick here?
--
  Richard Huxton

В списке pgsql-general по дате отправления:

Предыдущее
От: Ian Barwick
Дата:
Сообщение: Re: update phenomenom
Следующее
От: Ernest E Vogelsinger
Дата:
Сообщение: Re: Select from multiple tables