Skip site navigation (1) Skip section navigation (2)

Re: left outer join fails because "column .. does not exist in left table?"

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Rick(dot)Casey(at)colorado(dot)edu
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: left outer join fails because "column .. does not exist in left table?"
Date: 2010-06-30 23:25:25
Message-ID: AANLkTimahM3uGjnW9P24BPQEd0wV8rg16jBAmUJrbGV4@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
On Wed, Jun 30, 2010 at 7:01 PM,  <Rick(dot)Casey(at)colorado(dot)edu> wrote:
> I have a JOIN error that is rather opaque...at least to me.
>
> I've using other JOIN queries on this project, which seem very similar to
> this one, which looks like:
>
> SELECT S.subjectid,STY.studyabrv,labID,boxnumber,wellrow,wellcolumn
> FROM DNASample D, IBG_Studies STY, Subjects S, ibg_projects P
>  LEFT OUTER JOIN ibg_ps_join IPJ USING (dnasampleid)
> WHERE
>        D.subjectidkey=S.id
>        AND STY.studyindex=D.studyindex
>        AND IPJ.projects_index=P.ibg_projects_index
> ORDER BY studyabrv,boxnumber,wellcolumn,wellrow
>
> But when I run it I get this error:
>
> ERROR:  column "dnasampleid" specified in USING clause does not exist in
> left table
>
> I am rather mystified by this, since this field is definitely in the
> dnasample table, as the primary key. Nor do not see how to start debugging
> such an error. Any suggestions appreciated...

Capitalization maybe?  pgsql folds to lower case.

In response to

pgsql-general by date

Next:From: Michael GlaesemannDate: 2010-06-30 23:27:26
Subject: Re: Can't EXTRACT number of months from an INTERVAL
Previous:From: Rick.CaseyDate: 2010-06-30 23:01:58
Subject: left outer join fails because "column .. does not exist in left table?"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group