Re: help w/ query - Mailing list pgsql-general

From Ernesto Baschny
Subject Re: help w/ query
Date
Msg-id 3BD690ED.12981.8C50CA@localhost
Whole thread Raw
In response to help w/ query  ("G.L. Grobe" <gary@grobe.net>)
List pgsql-general
On 19 Oct 2001 at 19:32, G.L. Grobe wrote:

> Anyone help w/ the following sql query ... Here's my tables
...
>
> table A
> id      name
> -----|-------
> 1000 AA
> 1001  AB
> 1002 AC
> 1003 AD
>
> table B
> id  pid
> -----|-------
> 1000 1000
> 1001 1000
> 1002 1000
> 1003 1001
> 1004 1001
>
> Here's my query, (note that 'AA' is all the info I provide,
> cause that's the ) ...
>
> SELECT B.id FROM B, A WHERE B.pid = A.id AND A.name = 'AA';

I think you misspelled the first parameter of the first
WHERE condition. It should be  "B.id", not "B.pid":

  SELECT B.id FROM B, A WHERE B.id = A.id AND A.name = 'AA';


--
Ernesto Baschny <ernst@baschny.de>
 http://www.baschny.de - PGP Key:
http://www.baschny.de/pgp.txt
 Sao Paulo/Brasil - Stuttgart/Germany
 Ernst@IRCnet - ICQ# 2955403


pgsql-general by date:

Previous
From: "Colin 't Hart"
Date:
Subject: Re: Evaluating PostgreSQL
Next
From: "Dinesh Parikh"
Date:
Subject: GUID in postgres