From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
---|---|
To: | "G(dot)L(dot) Grobe" <gary(at)grobe(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: query help |
Date: | 2001-08-31 00:22:09 |
Message-ID: | Pine.BSF.4.21.0108301721130.55818-100000@megazone23.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Maybe this?
select label from TableB, TableA
where TableB.idA=TableA.idA
and TableA.name=<whatever>
On Thu, 30 Aug 2001, G.L. Grobe wrote:
> Hi all,
>
> How would I get TableB.label if all I know about is TableA.name?
>
> I was thinking about a query on TableA first, then within the while
> (rs.next()), I'd do another query using the result set from A on B, but I
> don't like that much, and it seems kind of slow.
>
> Any help much appreciated!
>
> TableA
> idA | name | class
> -----------------
> 11 test1 1
> 12 test2 1
> 13 test3 2
> 14 test4 2
>
> TableB
> idB | idA | label
> ----------------
> 1 11 nameA
> 2 12 nameB
> 3 13 nameC
> 4 14 nameD
From | Date | Subject | |
---|---|---|---|
Next Message | Martin | 2001-08-31 00:51:14 | Problem with large select - PostgreSQL starts eating memory/disk |
Previous Message | Stephan Szabo | 2001-08-31 00:08:31 | Re: Re: quick question: index optimisations on small tables |