7.0.3 select/join syntax?

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: 7.0.3 select/join syntax?
Date: 2001-06-16 20:53:34
Message-ID: 20010616155334.B14950@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

i've been perusing the source code for Aparthia (it's a mod_perl
and HTML::Mason website framework that hooks into postgresql)
which contained some perl stuff like

my $st = $dbh->prepare("SELECT a.auction_id,a.title,f.grade,f.comment, login(f.person_id)
FROM forum f join auction a on (auction_id)
WHERE f.auction_id = ? and f.person_id = ?");

i can't find "JOIN" in the documentation i've got (for 7.0.3)
regarding the SELECT statement...

select
a.auction_id,
a.title,
f.grade,
f.comment,
login(f.person_id)
from
forum f
JOIN auction a ON (auction_id) -- say what?
where
f.auction_id = ?
and
f.person_id = ?

i presume that basically adds a WHERE clause like
forum f join auction a on (auction_id)
==
where f.auction_id = a.auction_id
? (i could be wrong, i suppose.)

which i tried on some of my databases, and what i get instead is
"ambiguous"--

> select e.name,t.name from _edu e join _topic t on (id);
ERROR: Column 'id' is ambiguous

are there some unreleased docs that detail this feature?

--
I figure: if a man's gonna gamble, may as well do it
without plowing. -- Bama Dillert, "Some Came Running"

will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-06-16 22:28:35 Re: 7.0.3 select/join syntax?
Previous Message will trillich 2001-06-16 20:46:45 Re: Need help with COPY