Re: Stuck with references

From: "Jim Buttafuoco" <jim(at)contactbda(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Frodo Larik <lists(at)e-l33t(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Stuck with references
Date: 2005-03-25 19:00:55
Message-ID: 20050325190043.M92675@contactbda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I did say untested :)

---------- Original Message -----------
From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Jim Buttafuoco <jim(at)contactbda(dot)com>
Cc: Frodo Larik <lists(at)e-l33t(dot)com>, pgsql-general(at)postgresql(dot)org
Sent: Fri, 25 Mar 2005 09:05:50 -0700
Subject: Re: [GENERAL] Stuck with references

> On Fri, Mar 25, 2005 at 10:37:31AM -0500, Jim Buttafuoco wrote:
> >
> > try the following (untested) query:
> >
> > SELECT la.name,lb.name pp.distance FROM payway_profile AS pp
> > JOIN location AS la ON ( pp.location_a = l.location_id )
> > join location AS lb ON ( pp.location_b = l.location_id );
>
> This query produces a syntax error due to a missing comma after
> lb.name, and "relation does not exist" errors due to the use of "l"
> instead of "la" and "lb" in the join conditions. Try this instead:
>
> SELECT la.name, lb.name, pp.distance
> FROM payway_profile AS pp
> JOIN location AS la ON (pp.location_a = la.location_id)
> JOIN location AS lb ON (pp.location_b = lb.location_id);
>
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
------- End of Original Message -------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lucas F. 2005-03-25 19:17:29 syntax issue with custom aggregator
Previous Message Steve Atkins 2005-03-25 18:35:22 Re: Persistent data per connection