Re: Select from multiple tables - Mailing list pgsql-general

From Richard Huxton
Subject Re: Select from multiple tables
Date
Msg-id 200306061958.58817.dev@archonet.com
Whole thread Raw
In response to Select from multiple tables  (Jon Earle <je_pgsql@kronos.honk.org>)
List 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 by date:

Previous
From: Ian Barwick
Date:
Subject: Re: update phenomenom
Next
From: Ernest E Vogelsinger
Date:
Subject: Re: Select from multiple tables