Re: help w/ query

From: "Ernesto Baschny" <ernst(at)baschny(dot)de>
To: pgsql-general(at)postgresql(dot)org
Cc: "G(dot)L(dot) Grobe" <gary(at)grobe(dot)net>
Subject: Re: help w/ query
Date: 2001-10-24 07:59:09
Message-ID: 3BD690ED.12981.8C50CA@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)baschny(dot)de>
http://www.baschny.de - PGP Key:
http://www.baschny.de/pgp.txt
Sao Paulo/Brasil - Stuttgart/Germany
Ernst(at)IRCnet - ICQ# 2955403

In response to

Browse pgsql-general by date

  From Date Subject
Next Message James Szabadics 2001-10-24 08:31:57 Installation problems
Previous Message Paul Kinlan 2001-10-24 07:47:42 Re: Data Type