Re: Stuck with references

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Stuck with references
Дата
Msg-id 20050325160549.GA59883@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Stuck with references  ("Jim Buttafuoco" <jim@contactbda.com>)
Ответы Re: Stuck with references  ("Jim Buttafuoco" <jim@contactbda.com>)
Список pgsql-general
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/

В списке pgsql-general по дате отправления:

Предыдущее
От: "Jim Buttafuoco"
Дата:
Сообщение: Re: Stuck with references
Следующее
От: Jeff Amiel
Дата:
Сообщение: Persistent data per connection